C interface to Zymkey Application Utilities Library.
This file contains the C API to the the Zymkey Application Utilities library. This API facilitates writing user space applications which use Zymkey to perform cryptographic operations, such as:
Supported key types.
Supported recovery strategies.
Supported ECDH key derivation function types.
Accelerometer axis enum, used to set tap sensitivity.
Possible actions for threshold monitor functions.
zkGetAccelerometer data output.
zkGetAccelerometer data output.
the axis reading in units of g-force.
the direction of the force along the axis which caused a tap event: -1 = negative +1 = positive 0 = did not cause a tap event.
Supported key types.
Supported recovery strategies.
Supported ECDH key derivation function types.
Accelerometer axis enum, used to set tap sensitivity.
Possible actions for threshold monitor functions.
Open a Zymkey context.
(output) returns a pointer to a Zymkey context.
0 for success, less than 0 for failure.
Close a Zymkey context.
(input) The Zymkey context to close.
0 for success, less than 0 for failure.
Fill a file with random numbers.
(input) Zymkey context.
(input) Absolute path name for the destination file.
(input) The number of random bytes to generate.
0 for success, less than 0 for failure.
Get an array of random bytes.
(input) Zymkey context.
(input) Pointer to a pointer of bytes.
(input) The number of random bytes to generate.
0 for success, less than 0 for failure.
Lock up source (plaintext) data from a file and store the results (ciphertext) in a destination file.
This function encrypts and signs a block of plaintext data from a file and stores the result in a destination file.
(input) Zymkey context.
(input) The absolute path to the file where the source (plaintext) data is located.
(input) The absolute path to the file where the destination (ciphertext) data should be deposited.
(input) This parameter specifies which key will be used to used to lock the data up. A value of “false” specifies that the Zymkey will use the one-way key whereas “true” specifies that the shared key will be used. Specify “true” for publishing data to another that has the shared key (e.g. Zymbit cloud) and “False” when the data is meant to reside exclusively withing the host computer.
0 for success, less than 0 for failure.
Lock up source (plaintext) data from a byte array and store the results (ciphertext) in a destination file.
This function encrypts and signs a block of binary plaintext data and stores the result in a destination file.
(input) Zymkey context.
(input) Binary plaintext source byte array.
(input) Size of plaintext source data.
(input) The absolute path to the file where the destination (ciphertext) data should be deposited.
(input) Specifies if shared key is to be used. See zkLockDataF2F.
0 for success, less than 0 for failure.
Lock up source (plaintext) data from a file and store the results (ciphertext) in a destination byte array.
This function encrypts and signs a block of plaintext data from a file and stores the result in a binary byte array.
(input) Zymkey context.
(input) The absolute path to the file where the source (plaintext) data is located.
(output) A pointer to a pointer to an array of unsigned bytes created by this function. This pointer must be freed by the application when no longer needed.
(output) A pointer to an integer which contains the size of the destination array.
(input) Specifies if shared key is to be used. See zkLockDataF2F.
0 for success, less than 0 for failure.
Lock up source (plaintext) data from a byte array and store the results (ciphertext) in a destination byte array.
This function encrypts and signs a block of plaintext data and stores the result in a binary byte array.
(input) Zymkey context.
(input) Binary plaintext source byte array.
(input) Size of plaintext source data.
(output) A pointer to a pointer to an array of unsigned bytes created by this function. This pointer must be freed by the application when no longer needed.
(output) A pointer to an integer which contains the size of the destination array.
(input) Specifies if shared key is to be used. See zkLockDataF2F.
0 for success, less than 0 for failure.
Unlock source (ciphertext) data from a file and store the results (plaintext) in a destination file.
This function verifies a locked object signature and decrypts the associated ciphertext data.
(input) Zymkey context.
(input) The absolute path to the file where the source (ciphertext) data is located.
(input) The absolute path to the file where the destination (plaintext) data should be deposited.
(input) This parameter specifies which key will be used to used to lock the data up. A value of “false” specifies that the Zymkey will use the one-way key whereas “true” specifies that the shared key will be used. Specify “true” for publishing data to another that has the shared key (e.g. Zymbit cloud) and “False” when the data is meant to reside exclusively withing the host computer.
0 for success, less than 0 for failure.
Unlock source (ciphertext) data from a byte array and store the results (plaintext) in a destination file.
This function verifies a locked object signature and decrypts the associated ciphertext data.
(input) Zymkey context.
(input) Binary ciphertext source byte array.
(input) Size of ciphertext source data.
(input) The absolute path to the file where the destination (plaintext) data should be deposited.
(input) Specifies if shared key is to be used. See zkLockDataF2F.
0 for success, less than 0 for failure.
Unlock source (ciphertext) data from a file and store the results (plaintext) in a destination byte array.
This function verifies a locked object signature and decrypts the associated ciphertext data.
(input) Zymkey context.
(input) The absolute path to the file where the source (ciphertext) data is located.
(output) A pointer to a pointer to an array of unsigned bytes created by this function. This pointer must be freed by the application when no longer needed.
(output) A pointer to an integer which contains the size of the destination array.
(input) Specifies if shared key is to be used. See zkLockDataF2F.
0 for success, less than 0 for failure.
Unlock source (ciphertext) data from a byte array and store the results (plaintext) in a destination byte array.
This function verifies a locked object signature and decrypts the associated ciphertext data.
(input) Zymkey context.
(input) Binary ciphertext source byte array.
(input) Size of ciphertext source data.
(output) A pointer to a pointer to an array of unsigned bytes created by this function. This pointer must be freed by the application when no longer needed.
(output) A pointer to an integer which contains the size of the destination array.
(input) Specifies if shared key is to be used. See zkLockDataF2F.
0 for success, less than 0 for failure.
Generate a signature using the Zymkey’s ECDSA private key.
(input) Zymkey context.
(input) This parameter contains the digest of the data that will be used to generate the signature.
(input) The key slot to generate a signature from. This parameter is only valid for Zymkey models 4i and beyond.
(output) A pointer to a pointer to an array of unsigned bytes which contains the generated signature. This pointer is created by this function and must be freed by the application when no longer needed.
(output) A pointer to an integer which contains the size of the signature.
0 for success, less than 0 for failure.
Generate a signature using the Zymkey’s ECDSA private key.
(input) Zymkey context.
(input) This parameter contains the digest of the data that will be used to generate the signature.
(input) The key slot to generate a signature from. This parameter is only valid for Zymkey models 4i and beyond.
(output) A pointer to a pointer to an array of unsigned bytes which contains the generated signature. This pointer is created by this function and must be freed by the application when no longer needed.
(output) A pointer to an integer which contains the size of the signature.
(output) Returns recovery id value needed for ethereum key recovery.
0 for success, less than 0 for failure.
Verify a signature using one of the Zymkey’s public keys.
Verify a signature using an internal public key from the Zymkey private/public key store.
(input) Zymkey context.
(input) This parameter contains the digest of the data that will be used to generate the signature.
(input) The key slot to generate a signature from. This parameter is only valid for Zymkey models 4i and beyond.
(input) Array of bytes which contains the signature.
(input) Size of signature.
0 for signature verification failed, 1 for signature verification passed, less than 0 for general failure.
Verify a signature using one of the Zymkey’s foreign public keys.
Verify a signature using a public key from the Zymkey foreign key store.
(input) Zymkey context.
(input) This parameter contains the digest of the data that will be used to generate the signature.
(input) The key slot to generate a signature from. This parameter is only valid for Zymkey models 4i and beyond.
(input) Array of bytes which contains the signature.
(input) Size of signature.
0 for signature verification failed, 1 for signature verification passed, less than 0 for general failure.
Perform a raw ECDH operation. (Supported Devices: HSM6, Secure Compute Module).
Perform an ECDH operation with no Key Derivation Function (KDF). The raw pre-master secret is returned in the response. The peer public key is presented in the call.
(input) Zymkey context.
(input) The key slot to use for the local key. If this parameter is -1, the ephemeral key is used.
(input) The peer public key.
(input) Size of the peer public key.
(output) returned pointer to the pre-master secret.
0 for success, less than 0 for general failure.
Perform a raw ECDH operation. (Supported Devices: HSM6, Secure Compute Module).
Perform an ECDH operation with no Key Derivation Function (KDF). The raw pre-master secret is returned in the response. The peer public key is referenced from the zymkey internal key store.
(input) Zymkey context.
(input) The key slot to use for the local key. If this parameter is -1, the ephemeral key is used.
(input) The peer public key slot where the peer public key is to be found.
(input) If true, the peer public key slot is found in the foreign public keyring.
(output) returned pointer to the pre-master secret.
0 for success, less than 0 for general failure.
Perform an ECDH operation plus Key Derivation Function. (Supported Devices: HSM6, Secure Compute Module).
Perform an ECDH operation with Key Derivation Function (KDF). The derived key is returned in the response. The peer public key is presented in the call.
(input) Zymkey context.
(input) The key slot to use for the local key. If this parameter is -1, the ephemeral key is used.
(input) The peer public key.
(input) Size of the peer public key.
(input) The salt to use for the selected KDF.
(input) The salt size. Must be less than or equal to 128 bytes.
(input) The info field to use for RFC 5869. Ignored for PBKDF2.
(input) The size of the info parameter. Must be less than or equal to 128 bytes.
(input) Number of iterations to carry out (PBKDF only).
(input) The desired number of bytes to return for the KDF. For RFC 5869, this value must be less than 8160 bytes (SHA256) or 16320 (SHA512).
(output) returned pointer to the derived key.
0 for success, less than 0 for general failure.
Perform an ECDH operation plus Key Derivation Function. (Supported Devices: HSM6, Secure Compute Module).
Perform an ECDH operation with Key Derivation Function (KDF). The derived key is returned in the response. The peer public key is referenced from the zymkey internal key store.
(input) Zymkey context.
(input) The key slot to use for the local key. If this parameter is -1, the ephemeral key is used.
(input) The peer public key slot where the peer public key is to be found.
(input) If true, the peer public key slot is found in the foreign public keyring.
(input) The salt to use for the selected KDF.
(input) The salt size. Must be less than or equal to 128 bytes.
(input) The info field to use for RFC 5869. Ignored for PBKDF2.
(input) The size of the info parameter. Must be less than or equal to 128 bytes.
(input) Number of iterations to carry out (PBKDF only).
(input) The desired number of bytes to return for the KDF. For RFC 5869, this value must be less than 8160 bytes (SHA256) or 16320 (SHA512).
(output) returned pointer to the derived key.
0 for success, less than 0 for general failure.
[DEPRECATED] Use zkExportPubKey2File. Store the public key to a host file in PEM format.
This function is useful for generating Certificate Signing Requests (CSR).
(input) Zymkey context.
(input) Filename where PEM formatted public key is to be stored.
(input) The key slot to retrieve. Only valid for model 4i and above.
0 for success, less than 0 for failure.
Store the public key to a host file in PEM format.
This function is useful for generating Certificate Signing Requests (CSR).
(input) Zymkey context.
(input) Filename where PEM formatted public key is to be stored.
(input) The key slot to retrieve. Zymkey and HSM4 have slots 0, 1, and 2.
(input) If true, designates the pubkey slot to come from the foreign keystore. (Supported Devices: HSM6, Secure Compute Module).
0 for success, less than 0 for failure.
[DEPRECATED] Use zkExportPubKey. Gets the public key and stores in a byte array created by this function.
(input) Zymkey context.
(output) Pointer to a pointer created by this function which contains the public key.
(output) Pointer to an integer which contains the size of the public key.
(input) The key slot to retrieve. Only valid for model 4i and above.
0 for success, less than 0 for failure.
Gets the public key and stores in a byte array created by this function.
(input) Zymkey context.
(output) Pointer to a pointer created by this function which contains the public key.
(output) Pointer to an integer which contains the size of the public key.
(input) The key slot to retrieve. Zymkey and HSM4 have slots 0, 1, and 2.
(input) If true, designates the pubkey slot to come from the foreign keystore (Supported Devices: HSM6, Secure Compute Module).
0 for success, less than 0 for failure.
Get the list of allocated keys (Supported Devices: HSM6, Secure Compute Module).
This function returns a list of all allocated key slots.
(input) Zymkey context.
(input) if true, retrieve allocation list of the foreign keys.
(input) retrieves the key pool size.
(output) a pointer to an array of integers provided by this function to the caller.
(output) a pointer to an integer which contains the size of the returned key list.
0 if successful, less than 0 for failure.
Store a new foreign public key in Zymkey. (Supported Devices: HSM6, Secure Compute Module).
This function stores a new foreign public key in the Zymkey public key ring. This public key can be used for signature verification in use cases where it is desirable to hide the public key.
(input) Zymkey context.
(input) The type of the public key.
(input) Pointer to the public key to store.
(input) The public key size.
allocated slot number in foreign key store, less than 0 for failure.
Prevent a public key from being exported to the host. (Supported Devices: HSM6, Secure Compute Module).
This function prevents the public key at the specified slot from being exported to the host using the API zkExportPubKey.
(input) Zymkey context.
(input) The key slot to disable pubkey export on.
(input) The slot parameter refers to a slot in the foreign keyring.
0 for success, less than 0 for failure.
Generate a new persistent key pair. (Supported Devices: HSM6, Secure Compute Module).
This function generates a new key pair of the specified type and store it persistently. This key pair cannot be used as part of the zymkey’s digital wallet operations.
(input) Zymkey context.
(input) The type of key to generate (ZK_EC_KEY_TYPE).
allocated slot number if successful, less than 0 for failure.
Generate an ephemeral key pair. (Supported Devices: HSM6, Secure Compute Module).
This function generates an ephemeral key pair of the specified type. Ephemeral key pairs are useful when performing ECDH for time-of-flight encryption. Only one ephemeral key slot is available and is not persistent between reboots.
(input) Zymkey context.
(input) The type of key to generate (ZK_EC_KEY_TYPE).
0 if successful, less than 0 for failure.
Remove a key pair or a foreign public key. (Supported Devices: HSM6, Secure Compute Module).
This function deletes a key pair or a foreign public key from persistent storage.
(input) Zymkey context.
(input) The slot.
(input) The slot parameter refers to a slot in the foreign keyring.
0 if successful, less than 0 for failure.
Invalidate the ephemeral key. (Supported Devices: HSM6, Secure Compute Module).
This function invalidates the ephemeral key.
(input) Zymkey context.
0 for success, less than 0 for failure.
Generate master seed to start a new blockchain wallet. (Supported Devices: HSM6, Secure Compute Module).
This function generates a new blockchain master seed for creating a new wallet.
(input) Zymkey context.
(input) The type of key to generate (ZK_EC_KEY_TYPE).
(input) The variant of the key_type to generate. Currently only “cardano” is supported for ed25519.
(input) An ASCII string which contains the name of the wallet.
(input) The master generator key used to help generate the master seed. Can be empty string.
(input) The size of the master generator key. If 0, no master generator key is used in the formulation of the master seed.
(input) The passphrase to generate a different BIP39_mnemonic. Can be empty string.
(output) A pointer to the mnemonic sentence. If NULL, the master seed is generated per BIP32. Otherwise, the master seed is generated per recovery strategy and the mnemonic sentence is returned in this parameter. The string is null terminated and encoded in UTF-8 NFKD from the English dictionary.
allocated slot number if successful, less than 0 for failure.
Generate master seed to start a new blockchain wallet. (Supported Devices: HSM6, Secure Compute Module).
This function opens a session to generate a new blockchain master seed with the ability to recover from SLIP39 shards.
(input) Zymkey context.
(input) The type of key to generate (ZK_EC_KEY_TYPE).
(input) The variant of the key_type to generate. Currently only “cardano” is supported for ed25519.
(input) An ASCII string which contains the name of the wallet.
(input) The master generator key used to help generate the master seed. Can be empty string.
(input) The size of the master generator key. If 0, no master generator key is used in the formulation of the master seed.
(input) The total count of groups(shards) to split into.
(input) The count of groups(shards) needed to restore the master seed.
(input) The iteration of exponent of SLIP39.
(input) The master passphrase used for slip 39 recovery process.
0 if successful on opening a SLIP39 session, less than 0 for failure.
Set the active SLIP39 group and the amount of members needed. (Supported Devices: HSM6, Secure Compute Module).
This function configures the active group to generate the number of shards requested for the active group.
(input) Zymkey context.
(input) The index of the group to generate shards from. Index starts at 0.
(input) The total amount of member shards in this group to generate.
(input) The number of member shards needed to recreate this group in recovery.
0 if successful on configuring the active group, less than 0 for failure.
Generate a new SLIP39 member shard. (Supported Devices: HSM6, Secure Compute Module).
This function generates a new SLIP39 member shard. The shard can optionally have a password attached to it.
(input) Zymkey context.
(input) Password for the shard. Can be empty string.
(output) The mnemonic sentence of the shard.
0 if successful on opening a SLIP39 session, less than 0 for failure.
Cancels the current active SLIP39 session (Supported Devices: HSM6, Secure Compute Module).
This function cancels open active SLIP39 sessions. For both generation and restore SLIP39 sessions.
(input) Zymkey context.
0 if successful on aborting a SLIP39 session, less than 0 for failure.
Generate master seed to start a new blockchain wallet. (Supported Devices: HSM6, Secure Compute Module).
This function generates a new blockchain master seed for creating a new wallet.
(input) Zymkey context.
(input) The type of key to generate (ZK_EC_KEY_TYPE).
(input) The public key to create the oversight wallet from. Should come from a hardened node in a node tree.
(input) The chain code of the public key being used to create the oversight wallet.
(input) The node address index of the public key being used.
(input) The name of the oversight wallet being created.
allocated slot number if successful, less than 0 for failure.
Generate child key from a parent key in a blockchain wallet . (Supported Devices: HSM6, Secure Compute Module).
This function generates a new child key descendent from a specified parent key in a wallet.
(input) Zymkey context.
(input) The parent key slot to base the child key derivation on.
(input) The index of the child seed. This determines the node address as well as the outcome of the key generation.
(input) If true, a hardened key is generated.
(input) If true, returns the chain code of the public key that was just generated. Has to be a hardened node as well.
(output) the chain code of the public key.
allocated slot number if successful, less than 0 for failure.
Restore a master seed from a BIP39 mnemonic and a master generator key. (Supported Devices: HSM6, Secure Compute Module).
This function restores a wallet master seed from a supplied BIP39 mnemonic string and a master generator key.
(input) Zymkey context.
(input) The type of key to generate (ZK_KEY_TYPE).
(input) The variant of the key_type to generate. Currently only “cardano” is supported for ed25519.
(input) An ASCII string which contains the name of the wallet.
(input) The master generator key used to help generate the master seed.
(input) The size of the master generator key. If 0, no master generator key is used in the formulation of the master seed.
(input) The passphrase used to generate the BIP39_mnemonic.
(input) The BIP39_mnemonic string, null terminated and UTF-8 NFKD encoded from the BIP39 English dictionary.
allocated slot number if successful, less than 0 for failure.
Open a SLIP39 restore master seed session (Supported Devices: HSM6, Secure Compute Module).
This function starts a restore SLIP39 session, in order to start feeding shards into.
(input) Zymkey context.
(input) The type of key to generate (ZK_KEY_TYPE).
(input) The variant of the key_type to generate. Currently only “cardano” is supported for ed25519.
(input) An ASCII string which contains the name of the wallet.
(input) The master generator key used to help generate the master seed.
(input) The size of the master generator key. If 0, no master generator key is used in the formulation of the master seed.
(input) The master passphrase.
allocated slot number if successful, less than 0 for failure.
Feed a SLIP39 shard to restore a master seed (Supported Devices: HSM6, Secure Compute Module).
This function will feed a shard to the module until the conditions are met and a master seed is generated.
(input) Zymkey context.
(input) The passphrase that was attached to the shard.
(input) The twenty-four word sentence mnemonic shard.
allocated slot number when all shards required are fed in, less than 0 for no change.
Derive the node address from a key slot number. (Supported Devices: HSM6, Secure Compute Module).
This function derives a node address from an input key slot number.
(input) Zymkey context.
(input) A key slot number that is part of a digital wallet.
(output) A pointer to a pointer which will contain the node address in ASCII.
(output) A pointer to a pointer which will contain the wallet name in ASCII. If NULL, this parameter will not be retrieved.
(output) A pointer to an integer which will contain the master seed key slot. If NULL, this parameter will not be retrieved.
0 if successful, less than 0 for failure.
Derive the slot address from a node address. (Supported Devices: HSM6, Secure Compute Module).
This function returns the slot number associated with a given node address.
(input) Zymkey context.
(input) A pointer which contains the node address in ASCII.
(input) A pointer which contains the wallet name in ASCII, used to identify the wallet identity. If desired, this parameter can be NULL and the master_seed_slot parameter can be specified instead.
(input) The master seed slot. Can be used to specify the wallet identity instead of the wallet name.
(output) A pointer to an integer which contains the associated key slot.
0 if successful, less than 0 for failure.
Set perimeter breach action.
This function specifies the action to take when a perimeter breach event occurs. The possible actions are any combination of:
(input) The channel (0 or 1) that the action flags will be applied to.
(input) The actions to apply to the perimeter event channel:
0 for success, less than 0 for failure.
Set the low power period (Supported Devices: HSM6, Secure Compute Module).
This function sets low power period on the digital perimeter detect.
(input) Zymkey context.
(input) low power period in microseconds.
0 if successful, less than 0 for failure.
Set the low power max number of bits (Supported Devices: HSM6, Secure Compute Module).
This function sets low power max number of bits on the digital perimeter detect.
(input) Zymkey context.
(input) max number of bits.
0 if successful, less than 0 for failure.
Set the delays (Supported Devices: HSM6, Secure Compute Module).
This function sets delays on the digital perimeter detect.
(input) Zymkey context.
(input) minimum delay in nanoseconds.
(input) maximum delay in nanoseconds.
0 if successful, less than 0 for failure.
Wait for a perimeter breach event to be detected.
This function is called in order to wait for a perimeter breach event to occur. This function blocks the calling thread unless called with a timeout of zero. Note that, in order to receive perimeter events, the zymkey must have been configured to notify the host on either or both of the perimeter detect channels via a call to “zkSetPerimeterEventAction”.
(input) The maximum amount of time in milliseconds to wait for a perimeter event to arrive.
0 for success, less than 0 for failure, -ETIMEDOUT when no perimeter events detected within the specified timeout.
Get current perimeter detect info.
This function gets the timestamp of the first perimeter detect event for the given channel.
(output) The timestamps for when any breach occurred. The index in this array corresponds to the channel number used by zkSetPerimeterEventAction. A 0 value means no breach has occurred on this channel. This array is allocated by this routine and so it must be freed by the caller.
(output) The number of timestamps in the returned array.
0 for success, less than 0 for failure.
Clear perimeter detect events.
This function clears all perimeter detect event info and rearms all perimeter detect channels.
0 for success, less than 0 for failure.
Turns the LED off.
(input) Zymkey context.
0 for success, less than 0 for failure.
Turns the LED on.
(input) Zymkey context.
0 for success, less than 0 for failure.
Flashes the LED.
(input) Zymkey context.
(input) The amount of time, in milliseconds, that the LED will stay on during a flash cycle.
(input) The amount of time, in milliseconds, that the LED will stay off during a flash cycle.
(input) The number of on/off flash cycles to complete. If this parameter is 0, then the LED will flash indefinitely.
0 for success, less than 0 for failure.
Sets the i2c address of the Zymkey (i2c versions only).
This method should be called if the i2c address of the Zymkey is shared with another i2c device on the same i2c bus. The default i2c address for Zymkey units is 0x30. Currently, the address may be set in the ranges of 0x30 - 0x37 and 0x60 - 0x67. After successful completion of this command, the Zymkey will reset itself.
(input) The i2c address that the Zymkey will set itself to.
0 for success, less than 0 for failure.
Get current GMT time.
This function is called to get the time directly from a Zymkey’s Real Time Clock (RTC).
(output) The time in seconds from the epoch (Jan. 1, 1970).
(input) If true, this API returns the time after the next second falls. This means that the caller could be blocked up to one second. If false, the API returns immediately with the current time reading.
0 for success, less than 0 for failure.
Sets the sensitivity of tap operations.
This method permits setting the sensitivity of the tap detection feature. Each axis may be individually configured or all at once.
(input) The axis to configure. This parameter should contain one of the values in the enum typedef ACCEL_AXIS_TYPE.
(input) The sensitivity expressed as percentage.
0 for success, less than 0 for failure.
Wait for a tap event to be detected.
This function is called in order to wait for a tap event to occur. This function blocks the calling thread unless called with a timeout of zero.
(input) The maximum amount of time in milliseconds to wait for a tap event to arrive.
0 for success, less than 0 for failure, -ETIMEDOUT when no tap events detected within the specified timeout.
Get current accelerometer data and tap info.
This function gets the most recent accelerometer data in units of g forces plus the tap direction per axis.
(output) x axis accelerometer information y (output) y axis accelerometer information z (output) z axis accelerometer information.
0 for success, less than 0 for failure.
Set soft binding lock.
This function locks the binding for a specific HSM. This API is only valid for HSM series products.
0 for success, less than 0 for failure.
Get current binding info.
This function gets the current binding lock state as well as the current binding state. This API is only valid for devices in the HSM family.
(output) Binary value which expresses the current binding lock state. is_bound (output) Binary value which expresses the current bind state.
0 for success, less than 0 for failure.
Get Zymkey model number.
This function retrieves the model number of the zymkey referred to in a specified context.
(input) Zymkey context which was created with zkOpen.
(output) A double pointer to the model string. This function allocates this string. It is the caller’s responsibility to free it.
0 for success, less than 0 for failure.
Get Zymkey firmware version.
This function retrieves the firmware version number of the zymkey referred to in a specified context.
(input) Zymkey context which was created with zkOpen.
(output) A double pointer to the firmware version string. This function allocates this string. It is the caller’s responsibility to free it.
0 for success, less than 0 for failure.
Get Zymkey serial number.
This function retrieves the serial number of the zymkey referred to in a specified context.
(input) Zymkey context which was created with zkOpen.
(output) A double pointer to the serial number string. This function allocates this string. It is the caller’s responsibility to free it.
0 for success, less than 0 for failure.
Get current HSM CPU temperature. (Supported Devices: HSM6, Secure Compute Module).
This function gets the current HSM CPU temp.
(output) The temperature in celsius of the CPU.
0 for success, less than 0 for failure.
Get current AUX temperature. (Only for secure compute modules).
This function gets an aux temp. THIS FUNCTION IS FOR INTERNAL ZYMBIT USE ONLY.
(input) Zymkey context.
(input) Index for which aux temp to be polled.
(output) The temperature in celsius.
0 for success, less than 0 for failure.
Get current RTC drift. (Supported Devices: HSM6, Secure Compute Module).
This function is called to get the current RTC drift.
(output) The RTC drift.
0 for success, less than 0 for failure.
Get the battery voltage (Supported Devices: HSM6, Secure Compute Module).
This function gets the current battery voltage.
(input) Zymkey context.
(output) The current battery voltage value.
0 if successful, less than 0 for failure.
Set battery voltage threshold action. (Supported Devices: HSM6, Secure Compute Module).
This function specifies the action to take when the battery voltage falls below the threshold set by zkSetBatteryVoltageThreshold. If this function is never called, do nothing is default. There are three actions:
(input) The action to apply, specify one of the ZK_THRESHOLD_ACTION_TYPE:
0 for success, less than 0 for failure.
Sets the battery voltage threshold. (Supported Devices: HSM6, Secure Compute Module).
This function sets the threshold at which if the battery voltage falls bellow, the action set by zkSetBatteryVoltageAction will be carried out. The recommended threshold is 2.3V. If this function isn’t called 2.3V is assumed by default. Threshold must be below 2.5V.
(input) The threshold in Volts.
0 for success, less than 0 for failure.
Set HSM CPU temperature threshold action. (Supported Devices: HSM6, Secure Compute Module).
This function specifies the action to take when the HSM CPU temperature falls below the threshold set by zkSetCPULowTempThreshold, or rises above the threshold set by zkSetCPUHighTempThreshold. There are two actions to apply:
(input) The action to apply, used it’s named constant from ZK_THRESHOLD_ACTION_TYPE:
0 for success, less than 0 for failure.
Sets the HSM CPU low temperature threshold. (Supported Devices: HSM6, Secure Compute Module).
This function sets the threshold at which if the on-board HSM CPU’s tempreature falls below, the action set by zkSetCPUTempAction will be carried out. WARNING: You can lock yourself out in dev mode if you set a threshold above the CPU’s ambient temperature. The recommended setting is no more than 20C. If no threshold is set, -10 degrees celsius is set as default.
(input) The threshold in celsius.
0 for success, less than 0 for failure.
Sets the HSM CPU high temperature threshold. (Supported Devices: HSM6, Secure Compute Module).
This function sets the threshold at which if the on-board HSM CPU’s tempreature rises above, the action set by zkSetCPUTempAction will be carried out. WARNING: You can lock yourself out in dev mode if you set a threshold below the CPU’s ambient temperature. The recommended setting is no less than 40C. If no threshold is set, 65 degrees celsius is set as default.
(input) The threshold in celsius.
0 for success, less than 0 for failure.
Sets the Supervised boot policy. (Supported Devices: Secure Compute Module).
This function specifies the action to take when Supervised boot event triggers based on a file change.
(input) The actions to apply to the Supervised boot process:
0 for success, less than 0 for failure.
Update file manifest for Supervised boot to check. (Supported Devices: Secure Compute Module).
This function adds or updates files to be checked by Supervised boot.
(input) The file to be signed and checked by Supervised boot.
(input) The slot to sign the file with.
0 for success, less than 0 for failure.
Remove a file from file manifest for Supervised boot to check. (Supported Devices: Secure Compute Module).
This function removes a file to be checked by Supervised boot.
(input) The file to be removed from the Supervised boot manifest.
0 for success, less than 0 for failure.
Get file manifest for Supervised boot to check. (Supported Devices: Secure Compute Module).
This function gets the list of files to be checked by Supervised boot.
(output) The file manifest that is checked by Supervised boot.
0 for success, less than 0 for failure.