Key name.
Key algorithm.
Defines whether the key is exportable.
Defines whether the key is temporary.
Defines whether the key can be used in blockchain operations.
ATTENTION: Only certain keys will be allowed if blockchain is true:
Returns true if the key was created successfully.
Example code: Creating a key
Deletes a key stored in the HSM.
Key name.
Returns true if the key was successfully deleted.
Example code: Deleting a key
Locks a key in the HSM.
Key name.
Returns true if the key was successfully locked.
Example code: Locking a key
Unlocks a key in the HSM.
Key name.
Returns true if the key was successfully unlocked.
Example code: Unlocking a key
Import a cryptographic key into the HSM.
Key name.
Key algorithm, the same as used in the create function.
Data of the key to be imported.
Defines whether the key is exportable.
Defines whether the key is temporary.
Defines whether the key can be used in blockchain operations.
Returns true if the key was imported successfully.
Example code: Importing a symmetric key
Import a certificate into HSM.
Name of certificate.
Certificate to be imported.
Returns true if the certificate was imported successfully.
Example code: Importing a certificate
Generates a CSR (Certificate Signing Request).
This is a specialized function of HSM's PKCS#10 CSR generation API.
Key name.
Certificate data.
Hash algorithm to be used to generate the CSR. If not provided, the standard HSM algorithm will be used.
Returns the CSR in DER format.
Example code: Generating a PKCS#10
Exports the public key of an asymmetric pair stored in the HSM.
Key name.
If true, the key will be exported in X.509 format.
Buffer containing the key data.
Example code: Exporting an asymmetric public key
Exports the private part of the asymmetric key stored in the HSM.
Key name.
Buffer containing the key data according to the enums.KEY_EXPORT_FORMAT format.
Example code: Exporting an asymmetric private key
Exports the private key stored in the HSM in clear text.
Key name.
Buffer containing the key data according to the enums.KEY_EXPORT_FORMAT format.
Example code: Exporting a symmetric key
Exports the certificate stored in the HSM in clear text.
Key name.
Buffer containing the certificate.
Example code: Exporting certificate in plain text
Import a key encrypted by a KEK (Key Encryption Key).
Operating mode for importing the key.
Padding option for KEK operation.
Key name.
Name of the Key Encryption Key (KEK) that will be used to decrypt the imported key.
Object type.
Buffer containing the data of the encrypted key to be imported.
Initialization Vector. Mandatory for enums.KEK_MODE.MODE_CBC mode.
Defines whether the key is exportable.
Defines whether the key is temporary.
Defines whether the key can be used in blockchain operations.
Returns true if the key was imported successfully.
Example code: Importing KEKed key
Exports a key encrypted by a KEK (Key Encryption Key).
Operating mode for exporting the key.
Padding option for KEK operation.
Key name.
Name of the Key Encryption Key (KEK) that will be used to encrypt the exported key.
Initialization Vector. Mandatory for enums.KEK_MODE.MODE_CBC mode.
Buffer containing the encrypted key data.
Example code: Exporting KEKed key
Import a PKCS#8 key for the HSM.
Key name.
Key type.
Key password.
Key data in PKCS#8 format (base64).
Defines whether the key is exportable.
Defines whether the key is temporary.
Defines whether the key can be used in blockchain operations.
ATTENTION: Only certain keys will be allowed if blockchain is true:
Returns true if the key was imported successfully.
Example code: Importing and exporting with PKCS#8
Exports a PKCS#8 key from the HSM.
Key name.
Key password.
Returns a buffer containing the key data.
Example code: Importing and exporting with PKCS#8
Imports a private key and its corresponding certificate in PKCS#12 format into the HSM.
PKCS#12 (Public-Key Cryptography Standards #12) is a standard file format for storing private keys, certificates and other cryptographic secrets. It allows multiple objects to be stored in a single file and protected by a password.
The name of the key to be created in the HSM. This name must be unique and follow the HSM naming rules.
The name of the certificate to be created in the HSM. This name must be unique and follow the HSM naming rules.
The password that protects the PKCS#12 file.
The contents of the PKCS#12 file in the form of a Buffer. This buffer must contain the binary data from the PKCS#12 file.
Public key of the certificate in hexadecimal format.
Defines whether the key is exportable.
Defines whether the key is temporary.
A promise that resolves to true if the import is successful.
If an error occurs during the import, such as a communication error with the HSM or an incorrect password.
Example code: Importing a PKCS#12
Creates and stores a cryptographic key in the HSM, associated with an algorithm, according to the parameters entered.