Operations to support the security of Blockchain-based structures.
See the HSM technical documentation.
Functions | |
void | BchainCreateXPrvBtcMinikey (string szId, bool isExportable, bool isTemporary) |
Creates an XPriv private key for Bitcoin in minikey format. | |
void | BchainCreateXPrvBip32 (string szId, byte bVersion, bool isExportable, bool isTemporary) |
Creates an XPriv private key in BIP32 format. | |
void | BchainCreateXPrvBip32Seed (string szId, DinamoApi.DN_BCHAIN_BIP32_SEED_XPRV_DATA pData, bool isExportable, bool isTemporary) |
Creates an XPriv private key in BIP32 format using seed. | |
void | BchainCreateXPrvBip39Seed (string szId, DinamoApi.DN_BCHAIN_BIP39_SEED_XPRV_DATA pData, bool isExportable, bool isTemporary) |
Creates an XPriv private key in BIP39 format using seed. | |
DinamoApi.DN_BCHAIN_KEY_INFO | BchainCreateBip32Ckd (byte bVersion, UInt32 dwIndex, string szPar, string szDst, bool isExportable, bool isTemporary) |
Performs a Child Key Derivation (CKD) operation. Derives an Extended Private Key (XPrv) for the blockchain in the BIP32 standard. | |
byte[] | BchainSignHash (byte bType, byte bHashMode, byte[] pbHash, string szPk) |
Sign a hash using the Blockchain module. | |
byte[] | BchainGetPubKey (byte bType, string szId) |
Retrieves a public key using the blockchain module. | |
byte[] | BchainGetAddress (byte bType, byte bVersion, string szHrp, string szId) |
Retrieves the address of a key using the blockchain module. | |
byte[] | BchainEdDsaSign (byte bType, string szCtxStr, byte[] pbData, string szId) |
Generates an EdDsa signature using the blockchain module. | |
void | BchainGenerateKey (Dinamo.Hsm.DinamoClient.KEY_ALG dwAlg, string szId, bool isExportable, bool isTemporary) |
Generates a marked key for use in the blockchain module. | |
|
inline |
Creates an XPriv private key for Bitcoin in minikey format.
szId | Key identifier. |
isExportable | The key can be exported from the HSM. |
isTemporary | The key will only exist while the session is active. It will be destroyed after the session is closed. |
DinamoException | Throws exception in case of error. |
|
inline |
Creates an XPriv private key in BIP32 format.
szId | Key identifier. | ||||||||||
bVersion | Key version. See table below.
| ||||||||||
isExportable | The key can be exported from the HSM. | ||||||||||
isTemporary | The key will only exist while the session is active. It will be destroyed after the session is closed. |
DinamoException | Throws exception in case of error. |
|
inline |
Creates an XPriv private key in BIP32 format using seed.
szId | Key identifier. |
pData | Data for generating the key. |
isExportable | The key can be exported from the HSM. |
isTemporary | The key will only exist while the session is active. It will be destroyed after the session is closed. |
DinamoException | Throws exception in case of error. |
|
inline |
Creates an XPriv private key in BIP39 format using seed.
szId | Key identifier. |
pData | Data for generating the key. |
isExportable | The key can be exported from the HSM. |
isTemporary | The key will only exist while the session is active. It will be destroyed after the session is closed. |
DinamoException | Throws exception in case of error. |
|
inline |
Performs a Child Key Derivation (CKD) operation. Derives an Extended Private Key (XPrv) for the blockchain in the BIP32 standard.
bVersion | Key version. See table below.
| ||||||||||
dwIndex | Index of the key to be derived. Keys non hardened use the 0 a 231-1 and keys hardened (unrestrictedly secure) use indices of 231 a 232-1 as specified in the standard BIP32. It is highly recommended to generate hardened keys. Use DinamoApi.DN_BCHAIN_SECURE_BIP32_INDEX_BASE as a basis for generating indexes hardened (Ex. DinamoApi.DN_BCHAIN_SECURE_BIP32_INDEX_BASE + 1 ...). | ||||||||||
szPar | Identifier of the parent key. | ||||||||||
szDst | Identifier of the derived key. Must be an XPrv key(DinamoApi.DN_BCHAIN_BIP32_XPRV etc.) | ||||||||||
isExportable | The key can be exported from the HSM. | ||||||||||
isTemporary | The key will only exist while the session is active. It will be destroyed after the session is closed. |
DinamoException | Throws exception in case of error. |
|
inline |
Sign a hash using the Blockchain module.
bType | Key type.
| ||||||||||||
bHashMode | Hash type.
| ||||||||||||
pbHash | Hash calculated according to bHashMode . | ||||||||||||
szPk | Private key identifier. |
DinamoException | Throws exception in case of error. |
|
inline |
Retrieves a public key using the blockchain module.
bType | Key type.
| ||||||||||||||||
szId | Private key identifier. |
DinamoException | Throws exception in case of error. |
|
inline |
Retrieves the address of a key using the blockchain module.
bType | Type of address to be generated. It can be one of the values below.
|
bVersion | Address version. See table below.
| ||||||||||||||||||||||
szHrp | HRP (Human Readable Part) of the key. The values in the table are accepted. It must have a maximum size of DinamoApi.DN_BCHAIN_MAX_HRP
| ||||||||||||||||||||||
szId | Private key identifier. |
DinamoException | Throws exception in case of error. |
|
inline |
Generates an EdDsa signature using the blockchain module.
bType | Type of subscription to be generated. It can be one of the values below.
| ||||||||||
szCtxStr | Context string as defined in RFC-8032 of maximum size DinamoApi.DN_BCHAIN_EDDSA_MAX_CSTRL. Can be passed DinamoApi.DN_BCHAIN_EDDSA_CSTR_UNUSED. | ||||||||||
pbData | Data to be signed. | ||||||||||
szId | Private key identifier. |
DinamoException | Throws exception in case of error. |
|
inline |
Generates a marked key for use in the blockchain module.
dwAlg | Algorithm to be used. Dinamo.Hsm.DinamoClient.KEY_ALG |
szId | Key identifier. |
isExportable | The key can be exported from the HSM. |
isTemporary | The key will only exist while the session is active. It will be destroyed after the session is closed. |
DinamoException | Throws exception in case of error. |