![]() |
MIKAI
Library to modify content of a Mykey
|
Go to the source code of this file.
Macros | |
#define | SRIX_BLOCK_LENGTH 4 |
#define | SRIX_UID_LENGTH 8 |
#define | SRIX4K_BLOCKS 128 |
#define | SRIX4K_BYTES 512 |
Functions | |
const MIKAI_EXPORT char * | MikaiVersion () |
Get current version of mikai as string. More... | |
MIKAI_EXPORT MyKey * | MikaiNew () |
Create a new MyKey instance. More... | |
const MIKAI_EXPORT char * | MikaiInit (MyKey **target, uint32_t dump[const 128], uint64_t selection) |
Initialize a MyKey. More... | |
MIKAI_EXPORT void | MikaiDelete (MyKey *key) |
Delete a MyKey. More... | |
const MIKAI_EXPORT char * | MikaiGetLatestError (MyKey *key) |
Get a text description of latest error occured and reset it. More... | |
MIKAI_EXPORT uint32_t | MyKeyGetEncryptionKey (MyKey *key) |
Get MyKey encryption key. More... | |
MIKAI_EXPORT bool | MyKeyIsReset (MyKey *key) |
Check if a MyKey is reset (if it hasn't an associated vendor code). More... | |
MIKAI_EXPORT bool | MyKeyCheckLockID (MyKey *key) |
Return true if MyKey has lock id and checksum of credit is wrong. More... | |
MIKAI_EXPORT uint32_t | MyKeyGetBlock (MyKey *key, uint8_t blockNum) |
Get the value of a specific block. More... | |
MIKAI_EXPORT void | MyKeyModifyBlock (MyKey *key, uint32_t block, uint8_t blockNum) |
Modify a MyKey block manually. More... | |
MIKAI_EXPORT void | MyKeyImportVendor (MyKey *key, uint32_t vendor) |
Import vendor code and recalculate encryption key. More... | |
MIKAI_EXPORT int | MyKeyExportVendor (MyKey *key, uint32_t *vendor) |
Decrypt vendor code and save it to vendor pointer. More... | |
MIKAI_EXPORT void | MyKeyExportMemory (MyKey *key, uint32_t dump[const 128], uint64_t *uid) |
Export SRIX data to specified memory locations. More... | |
MIKAI_EXPORT void | MyKeyReset (MyKey *key) |
Reset a MyKey to associate it with another vendor. More... | |
MIKAI_EXPORT uint16_t | MyKeyGetCurrentCredit (MyKey *key) |
Extract current credit from block 21. More... | |
MIKAI_EXPORT int | MyKeyAddCents (MyKey *key, uint16_t cents, uint8_t day, uint8_t month, uint8_t year) |
Add N cents to MyKey actual credit. More... | |
MIKAI_EXPORT int | MyKeySetCents (MyKey *key, uint16_t cents, uint8_t day, uint8_t month, uint8_t year) |
Reset credit history and charge N cents. More... | |
MIKAI_EXPORT void MikaiDelete | ( | MyKey * | key | ) |
const MIKAI_EXPORT char* MikaiGetLatestError | ( | MyKey * | key | ) |
Get a text description of latest error occured and reset it.
key | pointer to MyKey instance |
const MIKAI_EXPORT char* MikaiInit | ( | MyKey ** | target, |
uint32_t | dump[const 128], | ||
uint64_t | selection | ||
) |
Initialize a MyKey.
target | if it points to a null MyKey struct pointer, a new MyKey instance will be created, else an existing struct will be modified. |
dump | If it isn't null, the struct will be initialize in FILE DUMP mode |
selection | If dump isn't null, it's the uid, else it's the Reader selection (element of the readers array) |
MIKAI_EXPORT MyKey* MikaiNew | ( | ) |
const MIKAI_EXPORT char* MikaiVersion | ( | ) |
MIKAI_EXPORT int MyKeyAddCents | ( | MyKey * | key, |
uint16_t | cents, | ||
uint8_t | day, | ||
uint8_t | month, | ||
uint8_t | year | ||
) |
Add N cents to MyKey actual credit.
key | pointer to MyKey instance |
cents | cents to add |
day | day number in the month (1-31) |
month | month number in the year (1-12) |
year | year number from 2000 (0-127) |
MIKAI_EXPORT bool MyKeyCheckLockID | ( | MyKey * | key | ) |
MIKAI_EXPORT void MyKeyExportMemory | ( | MyKey * | key, |
uint32_t | dump[const 128], | ||
uint64_t * | uid | ||
) |
Export SRIX data to specified memory locations.
key | pointer to MyKey instance |
dump | pointer where copy SRIX EEPROM |
uid | pointer where save SRIX UID |
MIKAI_EXPORT int MyKeyExportVendor | ( | MyKey * | key, |
uint32_t * | vendor | ||
) |
Decrypt vendor code and save it to vendor pointer.
key | pointer to MyKey instance |
vendor | location where save vendor code |
MIKAI_EXPORT uint32_t MyKeyGetBlock | ( | MyKey * | key, |
uint8_t | blockNum | ||
) |
Get the value of a specific block.
key | pointer to MyKey instance |
blockNum | number of block to get |
MIKAI_EXPORT uint16_t MyKeyGetCurrentCredit | ( | MyKey * | key | ) |
Extract current credit from block 21.
key | pointer to MyKey instance |
MIKAI_EXPORT uint32_t MyKeyGetEncryptionKey | ( | MyKey * | key | ) |
MIKAI_EXPORT void MyKeyImportVendor | ( | MyKey * | key, |
uint32_t | vendor | ||
) |
Import vendor code and recalculate encryption key.
key | pointer to MyKey instance |
vendor | vendor code decrypted value |
MIKAI_EXPORT bool MyKeyIsReset | ( | MyKey * | key | ) |
MIKAI_EXPORT void MyKeyModifyBlock | ( | MyKey * | key, |
uint32_t | block, | ||
uint8_t | blockNum | ||
) |
MIKAI_EXPORT void MyKeyReset | ( | MyKey * | key | ) |
MIKAI_EXPORT int MyKeySetCents | ( | MyKey * | key, |
uint16_t | cents, | ||
uint8_t | day, | ||
uint8_t | month, | ||
uint8_t | year | ||
) |
Reset credit history and charge N cents.
key | pointer to MyKey instance |
cents | cents to add |
day | day number in the month (1-31) |
month | month number in the year (1-12) |
year | year number from 2000 (0-127) |