Managing the life cycle of cryptographic keys in HSM.
See the HSM technical documentation.
Functions | |
IntPtr | GenerateKey (string KeyId, DinamoClient.KEY_ALG Alg, bool Exportable) |
Generates a permanent key in the HSM. | |
IntPtr | GenerateKey (string KeyId, DinamoClient.KEY_ALG Alg, bool Exportable, bool Temporary) |
Generates key. | |
IntPtr | GetUserKey (string KeyId) |
Returns the Handler of a key (DestroyUserKey must be called after allocation). | |
void | DestroyKey (IntPtr hKey) |
Release key handle. | |
int | GetKeyAlgId (string strKeyId) |
Returns the algorithm of a key. | |
int | GetKeyAlgId (IntPtr hKey) |
Returns the type of a key. | |
int | GetKeyPadding (IntPtr hKey) |
Returns the padding type of a key. | |
int | GetUserKeyLen (string KeyId) |
Returns the size of a key. | |
int | GetUserKeyLen (IntPtr hKey) |
Returns the size of a key. | |
bool | IsKeyExist (string KeyId) |
bool | HasObject (string Id) |
Verifies the existence of an object. | |
void | GetMapInfo (string ObjectId, ref string Obj1Id, ref string Obj2Id) |
Retrieves map information (backward compatibility) | |
void | GetMapInfo (string ObjectId, ref string Obj1Id, ref int Obj1TypeId, ref string Obj2Id, ref int Obj2TypeId) |
Retrieves map information. | |
List< CertAssociation > | ListCertAssociations (bool onlyWithAssociation=false) |
Lists the certificates and their associated private keys. | |
bool | IsKeyReadLock (string KeyId) |
Test if the key is exportable. | |
bool | IsKeyReadLock (IntPtr hKey) |
Test if the key is exportable. | |
bool | IsKeyEncrypted (string KeyId) |
Test that the key is encrypted. | |
bool | IsKeyEncrypted (IntPtr hKey) |
Test that the key is encrypted. | |
void | BlockObject (string szObjectName, bool bBlock) |
Changes the lock status of an object. | |
bool | IsObjectBlocked (string szObjectName) |
Recovers the locked state of an object. | |
void | GenerateMap (string MapId, string Obj1Id, ALG Obj1Type, string Obj2Id, ALG Obj2Type) |
void | RemoveObject (string ObjectId) |
Removes an object from the HSM. | |
void | RemoveObjectIfExists (string ObjectId) |
Removes an object from the HSM, if it exists. | |
string[] | ListObjects () |
Lists the objects of the current HSM user. | |
Int32 | ListCallback (string szName, ref DinamoApi.DBLOB pParam, Int32 bFinal) |
string[] | ListObjects(ALG type) |
byte[] | ReadFile (string FileId) |
Int32 | WriteLocalFileCallback (IntPtr pbData, Int32 cbData, ref DinamoApi.DBLOB_FILE pParam, Int32 bFinal) |
void | WriteFile (string FileId, byte[] byFileData) |
Imports objects into the HSM. Certificates, PKCS#7, Keys. | |
Int32 | ReadLocalFileCallback (IntPtr pbData, ref Int32 pcbData, IntPtr pParam, out Int32 pbFinal) |
byte[] | ExportKey (IntPtr hKey, IntPtr hKeyEncryptionKey, BLOB_TYPE BlobType) |
IntPtr | ImportKey (string KeyId, IntPtr hKeyEncryptionKey, byte[] byKeyBlob, BLOB_TYPE BlobType, KEY_ALG AlgId) |
IntPtr | ImportKey (string KeyId, IntPtr hKeyEncryptionKey, byte[] byKeyBlob, BLOB_TYPE BlobType, KEY_ALG AlgId, bool Exportable, bool Temporary) |
void | ImportPKCS12File (string FilePath, string Password, string KeyId, string CertId, bool Exportable) |
Imports a key/certificate from a file in PKCS#12 format into the HSM. | |
Int32 | ImportPKCS12 (string FilePath, string Password, string KeyId, string CertId, bool Exportable) |
void | ImportPKCS12 (byte[] Pkcs12, string Password, string KeyId, string CertId, bool Exportable) |
Imports a key/certificate from a buffer in PKCS#12 format into the HSM. | |
void | ImportPKCS12 (byte[] Pkcs12, string Password, string KeyId, Int32 KeyAttr, string CertId, string PubKeyId, Int32 Reserved) |
Imports a key/certificate from a buffer in PKCS#12 format into the HSM. | |
byte[] | PKCS8ExportKey (string szKeyId, string szSecret) |
byte[] | SPBExportPKCS12 (string szISPB, string szSecret) |
byte[] | ExportPKCS12 (string KeyId, string CertId, string Secret) |
Exports an HSM key and certificate in PKCS#12 format. | |
byte[] | ExportPKCS12 (string KeyId, string CertId, string Secret, Int32 Flags) |
Exports an HSM key and certificate in PKCS#12 format. | |
void | PKCS8ImportKey (string szKeyId, string szSecret, int dwKeyAlg, int dwAttrib, byte[] bKeyEnvelope) |
void | SPBImportPKCS12 (string szKeyId, string szSecret, string szDomain, int dwKeyAlg, int dwAttrib, string file) |
|
inline |
Generates a permanent key in the HSM.
KeyId | Key identifier. This identifier must not contain spaces or special characters. Uppercase and lowercase characters are case-sensitive. An object identifier in HSM can have a maximum length, in characters, of DinamoApi.MAX_OBJ_NAME_LEN. When creating keys in another user's partition (permission required) the name must be fully qualified with an FQN(Full Qualified Name: partition_id/obj_id), the maximum length for an FQN is DinamoApi.MAX_OBJ_ID_FQN_LEN-1. |
Alg | Algorithm to be used. Dinamo.Hsm.DinamoClient.KEY_ALG |
Exportable | Flag indicating the generation of an exportable key. |
DinamoException | Throws exception in case of error. |
|
inline |
Generates key.
KeyId | Key identifier. This identifier must not contain spaces or special characters. Uppercase and lowercase characters are case-sensitive. An object identifier in HSM can have a maximum length, in characters, of DinamoApi.MAX_OBJ_NAME_LEN. When creating keys in another user's partition (permission required) the name must be fully qualified with an FQN(Full Qualified Name: partition_id/obj_id), the maximum length for an FQN is DinamoApi.MAX_OBJ_ID_FQN_LEN-1. |
Alg | Key algorithm. Dinamo.Hsm.DinamoClient.KEY_ALG |
Exportable | Flag to generate the exportable key. |
Temporary | Flag to generate a temporary key. This key has a life cycle for the duration of the session. |
DinamoException | Throws exception in case of error. |
|
inline |
Returns the Handler of a key (DestroyUserKey must be called after allocation).
KeyId | Key identifier |
DinamoException | Throws exception in case of error. |
|
inline |
Release key handle.
hKey | Key handle. |
DinamoException | Throws exception in case of error. |
|
inline |
Returns the algorithm of a key.
strKeyId | User name |
DinamoException | Throws exception in case of error. |
|
inline |
Returns the type of a key.
hKey | Key handle |
DinamoException | Throws exception in case of error. |
|
inline |
Returns the padding type of a key.
hKey | Key handle |
DinamoException | Throws exception in case of error. |
|
inline |
Returns the size of a key.
KeyId | Key identification |
DinamoException | Throws exception in case of error. |
|
inline |
Returns the size of a key.
hKey | Key handle |
DinamoException | Throws exception in case of error. |
|
inline |
|
inline |
Verifies the existence of an object.
Id | Object identifier in the HSM. |
DinamoException | Throws exception in case of error. |
|
inline |
Retrieves map information (backward compatibility)
ObjectId | Map name |
Obj1Id | Name of the object in the first slot |
Obj2Id | Name of the object in the second slot |
DinamoException | Throws exception in case of error. |
|
inline |
Retrieves map information.
ObjectId | Map name |
Obj1Id | Name of the object in the first slot |
Obj1TypeId | Object type in the first slot |
Obj2Id | Name of the object in the second slot |
Obj2TypeId | Object type in the second slot |
DinamoException | Throws exception in case of error. |
|
inline |
Lists the certificates and their associated private keys.
onlyWithAssociation | True if you only want certificates with associated keys |
DinamoException | Throws exception in case of error. |
|
inline |
Test if the key is exportable.
KeyId | Key name |
DinamoException | Throws exception in case of error. |
|
inline |
Test if the key is exportable.
hKey | Key handle |
DinamoException | Throws exception in case of error. |
|
inline |
Test that the key is encrypted.
KeyId | Key name |
DinamoException | Throws exception in case of error. |
|
inline |
Test that the key is encrypted.
hKey | Key handle |
DinamoException | Throws exception in case of error. |
|
inline |
Changes the lock status of an object.
szObjectName | Object name |
bBlock | true for locked and false for unlocked |
DinamoException | Throws exception in case of error. |
|
inline |
Recovers the locked state of an object.
szObjectName | Object name |
DinamoException | Throws exception in case of error. |
|
inline |
Removes an object from the HSM.
ObjectId | Object name |
DinamoException | Throws exception in case of error. |
|
inline |
Removes an object from the HSM, if it exists.
ObjectId | Object name |
DinamoException | Throws exception in case of error. |
|
inline |
Lists the objects of the current HSM user.
DinamoException | Throws exception in case of error. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Imports objects into the HSM. Certificates, PKCS#7, Keys.
FileId | Key identifier. This identifier must not contain spaces or special characters. Uppercase and lowercase characters are case-sensitive. An object identifier in HSM can have a maximum length, in characters, of DinamoApi.MAX_OBJ_NAME_LEN. When creating keys in another user's partition (permission required) the name must be fully qualified with an FQN(Full Qualified Name: partition_id/obj_id), the maximum length for an FQN is DinamoApi.MAX_OBJ_ID_FQN_LEN-1. |
byFileData | object in the |
DinamoException | Throws exception in case of error. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Imports a key/certificate from a file in PKCS#12 format into the HSM.
FilePath | Location of the physical PFX file to be imported. |
Password | Password to open PFX file. |
KeyId | Name that the imported key will have within the HSM. This identifier must not contain spaces or special characters. Uppercase and lowercase characters are case-sensitive. An object identifier in the HSM can have a maximum length, in characters, of DinamoApi.MAX_OBJ_NAME_LEN. When creating keys in another user's partition (permission required) the name must be fully qualified with an FQN(Full Qualified Name: partition_id/obj_id), the maximum length for an FQN is DinamoApi.MAX_OBJ_ID_FQN_LEN-1. |
CertId | Name that the imported certificate will have within the HSM. This identifier must not contain spaces or special characters. Uppercase and lowercase characters are case-sensitive. An object identifier in the HSM can have a maximum length, in characters, of DinamoApi.MAX_OBJ_NAME_LEN. When creating keys in another user's partition (permission required) the name must be fully qualified with an FQN(Full Qualified Name: partition_id/obj_id), the maximum length for an FQN is DinamoApi.MAX_OBJ_ID_FQN_LEN-1. |
Exportable | Import the key in exportable form. |
DinamoException | Throws exception in case of error. |
|
inline |
|
inline |
Imports a key/certificate from a buffer in PKCS#12 format into the HSM.
Pkcs12 | PKCS#12. |
Password | Password for PKCS#12. |
KeyId | Name that the imported key will have within the HSM. This identifier must not contain spaces or special characters. Uppercase and lowercase characters are case-sensitive. An object identifier in the HSM can have a maximum length, in characters, of DinamoApi.MAX_OBJ_NAME_LEN. When creating keys in another user's partition (permission required) the name must be fully qualified with an FQN(Full Qualified Name: partition_id/obj_id), the maximum length for an FQN is DinamoApi.MAX_OBJ_ID_FQN_LEN-1. |
CertId | Name that the imported certificate will have within the HSM. This identifier must not contain spaces or special characters. Uppercase and lowercase characters are case-sensitive. An object identifier in the HSM can have a maximum length, in characters, of DinamoApi.MAX_OBJ_NAME_LEN. When creating keys in another user's partition (permission required) the name must be fully qualified with an FQN(Full Qualified Name: partition_id/obj_id), the maximum length for an FQN is DinamoApi.MAX_OBJ_ID_FQN_LEN-1. |
Exportable | Import the key in exportable form. |
DinamoException | Throws exception in case of error. |
|
inline |
Imports a key/certificate from a buffer in PKCS#12 format into the HSM.
Pkcs12 | PKCS#12. | ||||
Password | Password for PKCS#12. | ||||
KeyId | Name that the imported key will have within the HSM. This identifier must not contain spaces or special characters. Uppercase and lowercase characters are case-sensitive. An object identifier in the HSM can have a maximum length, in characters, of DinamoApi.MAX_OBJ_NAME_LEN. When creating keys in another user's partition (permission required) the name must be fully qualified with an FQN(Full Qualified Name: partition_id/obj_id), the maximum length for an FQN is DinamoApi.MAX_OBJ_ID_FQN_LEN-1. | ||||
KeyAttr | Attributes of the key to be imported into the HSM. Additional parameters of the key.
| ||||
CertId | Name that the imported certificate will have within the HSM. This identifier must not contain spaces or special characters. Uppercase and lowercase characters are case-sensitive. An object identifier in the HSM can have a maximum length, in characters, of DinamoApi.MAX_OBJ_NAME_LEN. When creating keys in another user's partition (permission required) the name must be fully qualified with an FQN(Full Qualified Name: partition_id/obj_id), the maximum length for an FQN is DinamoApi.MAX_OBJ_ID_FQN_LEN-1. | ||||
PubKeyId | Name that the imported public key will have inside the HSM. Can be null to not import the public key object. | ||||
Reserved | Reserved for future use. Must be 0. |
DinamoException |
|
inline |
|
inline |
|
inline |
Exports an HSM key and certificate in PKCS#12 format.
KeyId | Name of the key to be exported. |
CertId | Name of the certificate to be exported. |
Secret | Password protection for PKCS#12. |
DinamoException | Throws exception in case of error. |
|
inline |
Exports an HSM key and certificate in PKCS#12 format.
KeyId | Name of the key to be exported. | ||||
CertId | Name of the certificate to be exported. | ||||
Secret | Password protection for PKCS#12. | ||||
Flags | Pass 0 or one of the options in the table below.
|
DinamoException | Throws exception in case of error. |
|
inline |
|
inline |