Operations to support the security of Blockchain-based structures.
See HSM technical documentation about operating details, specifications used, licenses e module trade name.
Operations to support the security of Blockchain-based structures. More...
Functions | |
| byte[] | bchainSignHash (byte bType, byte bHashMode, byte[] pbHash, String strPk) throws TacException |
| Sign a hash using the blockchain module. | |
| byte[] | bchainEdDsaSign (byte bType, String szCtxStr, byte[] pbData, String strPk) throws TacException |
| Generates an EdDsa signature using the blockchain module. | |
| void | bchainVerify (byte bSigType, byte bHashMode, byte[] pbHash, byte[] pbSig, byte bInPbkType, byte[] pbInPbk) throws TacException |
| Verifies a signature using the blockchain module. | |
| void | bchainEdDsaVerify (byte bType, String szCtxStr, byte[] pbData, byte bPbkType, byte[] pbPbk, byte[] pbSig) throws TacException |
| Verifies an EdDsa signature using the blockchain module. | |
| byte[] | bchainGetPubKey (byte bType, String jszId) throws TacException |
| Recover a public key from a private key using the blockchain module. | |
| byte[] | bchainGetAddress (byte bType, byte bVer, String szHrp, String szPk) throws TacException |
| Retrieves the address of a key using the blockchain module. | |
| BchainKeyInfo | bchainGetKeyInfo (String szId) throws TacException |
| Retrieves the properties of a key using the blockchain module. | |
| byte[] | bchainHashData (byte bMode, byte[] pbData) throws TacException |
| Calculates a hash using the blockchain module. | |
| BchainKeyInfo | bchainCreateCkdBip32 (byte bVer, int dwIndex, int dwAttributes, String szPar, String szDst) throws TacException |
| Derive a BIP32 XPrv child key in the blockchain module. | |
| BchainKeyInfo | bchainCreateCkdEd25519 (byte bCkdType, byte bVer, int dwIndex, int dwAttributes, String szPar, String szDst) throws TacException |
| Derive an Ed25519 XPrv child key using the BIP32/SLIP-0010 standard in the blockchain module. | |
| BchainKeyInfo | bchainCreateCkdP256 (byte bCkdType, byte bVer, int dwIndex, int dwAttributes, String szPar, String szDst) throws TacException |
| Derive a P-256 XPrv child key using the BIP32/SLIP-0010 standard in the blockchain module. | |
| void | bchainCreateXPrv (byte bType, int dwAttributes, String szId, byte[] pbData) throws TacException |
| Creates an XPrv key in the blockchain module. | |
| void | bchainCreateXPrv (byte bType, byte bVer, int dwAttributes, String szId) throws TacException |
| Creates an XPrv key without seed data in the blockchain module. | |
| void | bchainCreateXPrvBip32Seed (byte bVer, int dwAttributes, String szId, byte[] pbSeed) throws TacException |
| Creates an XPrv key from a BIP32 seed in the blockchain module. | |
| void | bchainCreateXPrvBip39Seed (byte bVer, int dwAttributes, String szId, String szSeed, String szPwd) throws TacException |
| Creates an XPrv key from a BIP39 seed in the blockchain module. | |
| byte[] bchainSignHash | ( | byte | bType, |
| byte | bHashMode, | ||
| byte[] | pbHash, | ||
| String | strPk ) throws TacException |
Sign a hash using the blockchain module.
| bType | Type of subscription to be generated. It can be one of the values below.
| ||||||||||||||||
| bHashMode | Hash type.
| ||||||||||||||||
| pbHash | Hash to be signed. | ||||||||||||||||
| strPk | Private key identifier. |
bType. | TacException |
| byte[] bchainEdDsaSign | ( | byte | bType, |
| String | szCtxStr, | ||
| byte[] | pbData, | ||
| String | strPk ) throws TacException |
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. Use TacNDJavaLib.DN_BCHAIN_EDDSA_CSTR_UNUSED when not applicable. | ||||||||||||||||||||
| pbData | Data to be signed. | ||||||||||||||||||||
| strPk | Name of the private key. |
bType. | TacException |
| void bchainVerify | ( | byte | bSigType, |
| byte | bHashMode, | ||
| byte[] | pbHash, | ||
| byte[] | pbSig, | ||
| byte | bInPbkType, | ||
| byte[] | pbInPbk ) throws TacException |
Verifies a signature using the blockchain module.
| bSigType | Signature type. It can be one of the values listed below.
| ||||||||||||||||
| bHashMode | Hash type. It can be one of the values listed below.
| ||||||||||||||||
| pbHash | Hash calculated according to the information in bHashMode. | ||||||||||||||||
| pbSig | Signature to be verified according to the information specified in bSigType. | ||||||||||||||||
| bInPbkType | Public key format. Can be one of the values below.
| ||||||||||||||||
| pbInPbk | Public key used for verification. |
| TacException |
| void bchainEdDsaVerify | ( | byte | bType, |
| String | szCtxStr, | ||
| byte[] | pbData, | ||
| byte | bPbkType, | ||
| byte[] | pbPbk, | ||
| byte[] | pbSig ) throws TacException |
Verifies an EdDsa signature using the blockchain module.
| bType | Type of signature to be verified. It can be one of the values below.
| ||||||||||||||||||||
| szCtxStr | Context string as defined in RFC-8032. Use TacNDJavaLib.DN_BCHAIN_EDDSA_CSTR_UNUSED when not applicable. | ||||||||||||||||||||
| pbData | Data to be verified. | ||||||||||||||||||||
| bPbkType | Public key format. Can be one of the values below.
| ||||||||||||||||||||
| pbPbk | Public key used for verification. | ||||||||||||||||||||
| pbSig | Signature to be verified. |
| TacException |
| byte[] bchainGetPubKey | ( | byte | bType, |
| String | jszId ) throws TacException |
Recover a public key from a private key using the blockchain module.
| bType | Format of the public key to be exported. Can be one of the values below.
| ||||||||||||||||||||||||||
| jszId | Private key identifier. |
bType. | TacException |
| byte[] bchainGetAddress | ( | byte | bType, |
| byte | bVer, | ||
| String | szHrp, | ||
| String | szPk ) throws TacException |
Retrieves the address of a key using the blockchain module.
| bType | Address type. It can be one of the values listed below.
| ||||||||||||||||||||||||||||||||||||||||||||||
| bVer | Address version based on the type. It can be one of the values below. | ||||||||||||||||||||||||||||||||||||||||||||||
| szHrp | HRP (Human Readable Part). It can be one of the values listed below.
| ||||||||||||||||||||||||||||||||||||||||||||||
| szPk | Name of the private key in the HSM. |
bType. | TacException |
| BchainKeyInfo bchainGetKeyInfo | ( | String | szId | ) | throws TacException |
Retrieves the properties of a key using the blockchain module.
| szId | Name of the key in the HSM. |
BchainKeyInfo. | TacException |
| byte[] bchainHashData | ( | byte | bMode, |
| byte[] | pbData ) throws TacException |
Calculates a hash using the blockchain module.
| bMode | Hash type. It can be one of the values listed below.
| ||||||||||||||||
| pbData | Data to be processed. Maximum size: DN_BCHAIN_MAX_HDATA_LEN (2 MB). |
bMode. | TacException |
| BchainKeyInfo bchainCreateCkdBip32 | ( | byte | bVer, |
| int | dwIndex, | ||
| int | dwAttributes, | ||
| String | szPar, | ||
| String | szDst ) throws TacException |
Derive a BIP32 XPrv child key in the blockchain module.
| bVer | Derived key version. It can be one of the values listed below.
| ||||||||||||
| dwIndex | Derivation index. Non-hardened keys: 0 to 2^31-1. Hardened keys: TacNDJavaLib#DN_BCHAIN_SECURE_BIP32_INDEX_BASE to TacNDJavaLib#DN_BCHAIN_SECURE_BIP32_INDEX_BASE + 2^31-1. | ||||||||||||
| dwAttributes | Additional key parameters. See createKey. | ||||||||||||
| szPar | Name of the parent key in the HSM. | ||||||||||||
| szDst | Name of the derived key to be created in the HSM. |
BchainKeyInfo. | TacException |
| BchainKeyInfo bchainCreateCkdEd25519 | ( | byte | bCkdType, |
| byte | bVer, | ||
| int | dwIndex, | ||
| int | dwAttributes, | ||
| String | szPar, | ||
| String | szDst ) throws TacException |
Derive an Ed25519 XPrv child key using the BIP32/SLIP-0010 standard in the blockchain module.
| bCkdType | Derivation type. It can be one of the values listed below.
| ||||||
| bVer | Derived key version. See the options table in bchainCreateCkdBip32(byte, int, int, String, String). | ||||||
| dwIndex | Derivation index. See the options table in bchainCreateCkdBip32(byte, int, int, String, String). | ||||||
| dwAttributes | Additional key parameters. See createKey. | ||||||
| szPar | Name of the parent key in the HSM. | ||||||
| szDst | Name of the derived key to be created in the HSM. |
BchainKeyInfo. | TacException |
| BchainKeyInfo bchainCreateCkdP256 | ( | byte | bCkdType, |
| byte | bVer, | ||
| int | dwIndex, | ||
| int | dwAttributes, | ||
| String | szPar, | ||
| String | szDst ) throws TacException |
Derive a P-256 XPrv child key using the BIP32/SLIP-0010 standard in the blockchain module.
| bCkdType | Derivation type. It can be one of the values listed below.
| ||||
| bVer | Derived key version. See the options table in bchainCreateCkdBip32(byte, int, int, String, String). | ||||
| dwIndex | Derivation index. See the options table in bchainCreateCkdBip32(byte, int, int, String, String). | ||||
| dwAttributes | Additional key parameters. See createKey. | ||||
| szPar | Name of the parent key in the HSM. | ||||
| szDst | Name of the derived key to be created in the HSM. |
BchainKeyInfo. | TacException |
| void bchainCreateXPrv | ( | byte | bType, |
| int | dwAttributes, | ||
| String | szId, | ||
| byte[] | pbData ) throws TacException |
Creates an XPrv key in the blockchain module.
| bType | Key generation type. It can be one of the values listed below.
| ||||||||||||||
| dwAttributes | Additional key parameters. See createKey. | ||||||||||||||
| szId | Name of the key in the HSM. | ||||||||||||||
| pbData | Buffer containing the key generation data based on the type specified in bType. It may be null for types that do not require data. |
| TacException |
| void bchainCreateXPrv | ( | byte | bType, |
| byte | bVer, | ||
| int | dwAttributes, | ||
| String | szId ) throws TacException |
Creates an XPrv key without seed data in the blockchain module.
Used with types that require only the key version: TacNDJavaLib.DN_BCHAIN_BIP32_XPRV, TacNDJavaLib.DN_BCHAIN_BIP32_ED25519_XPRV, and TacNDJavaLib.DN_BCHAIN_BIP32_P256_XPRV. For TacNDJavaLib.DN_BCHAIN_BTC_MINIKEY, use bVer 0.
| bType | Type of key generation. | ||||||||||||
| bVer | Key version. Used by the types TacNDJavaLib.DN_BCHAIN_BIP32_XPRV, TacNDJavaLib.DN_BCHAIN_BIP32_ED25519_XPRV e TacNDJavaLib.DN_BCHAIN_BIP32_P256_XPRV. To TacNDJavaLib.DN_BCHAIN_BTC_MINIKEY, enter 0. It can be one of the values below.
| ||||||||||||
| dwAttributes | Additional key parameters. See createKey. | ||||||||||||
| szId | Name of the key in the HSM. |
| TacException |
| void bchainCreateXPrvBip32Seed | ( | byte | bVer, |
| int | dwAttributes, | ||
| String | szId, | ||
| byte[] | pbSeed ) throws TacException |
Creates an XPrv key from a BIP32 seed in the blockchain module.
| bVer | Key version. See the options table in bchainCreateXPrv(byte, byte, int, String). |
| dwAttributes | Additional key parameters. See createKey. |
| szId | Name of the key in the HSM. |
| pbSeed | BIP32 seed. Maximum length of TacNDJavaLib.DN_BCHAIN_BIP32_SEED_LEN_MAX. |
| TacException |
| void bchainCreateXPrvBip39Seed | ( | byte | bVer, |
| int | dwAttributes, | ||
| String | szId, | ||
| String | szSeed, | ||
| String | szPwd ) throws TacException |
Creates an XPrv key from a BIP39 seed in the blockchain module.
The strings `szSeed` and `szPwd` must be in UTF-8 NFKD format, as specified in BIP39.
| bVer | Key version. See the options table in bchainCreateXPrv(byte, byte, int, String). |
| dwAttributes | Additional key parameters. See createKey. |
| szId | Name of the key in the HSM. |
| szSeed | BIP39 seed in UTF-8 NFKD. Maximum size of TacNDJavaLib.DN_BCHAIN_BIP39_SEED_LEN_MAX. |
| szPwd | BIP39 password in UTF-8 NFKD. May be an empty string. Maximum length is TacNDJavaLib.DN_BCHAIN_BIP39_PWD_LEN_MAX. |
| TacException |