Java API
HSM Dinamo
Loading...
Looking for...
No entries found
Blockchain

Detailed description

Operations to support the security of Blockchain-based structures.

See the HSM technical documentation.

Functions

byte[] bchainSignHash (byte bType, byte bHashMode, byte[] pbHash, String strPk) throws TacException
 Sign a hash using the blockchain module.
 
byte[] bchainGetPubKey (byte bType, String jszId) throws TacException
 Recover a public key from a private key using the blockchain module.
 

Functions

bchainSignHash()

byte[] bchainSignHash ( byte bType,
byte bHashMode,
byte[] pbHash,
String strPk ) throws TacException

Sign a hash using the blockchain module.

Parameters
bTypeType of subscription to be generated. It can be one of the values below.
Value Meaning
TacNDJavaLib.DN_BCHAIN_SIG_DER_ECDSA DER signature, in the format v || DER. SECG!SEC1 strict DER with low S as described in BIP62/66, BIP146, EIP2. With 'v' having a size of 1 byte. 'v' is the parity bit of 'r' and can have the values 0 or 1.
TacNDJavaLib.DN_BCHAIN_SIG_RAW_ECDSA RAW signature, in the format v || r || s. With 'v' having a size of 1 byte and 'r' and 's' each having a size of 32 bytes. 'v' is the parity bit of 'r' and can have the values 0 or 1.
TacNDJavaLib.DN_BCHAIN_SIG_BIP340 Signature BIP340 - Schnorr 64 bytes.
bHashModeHash type.
Value Meaning
TacNDJavaLib.DN_BCHAIN_HASH_BTC_H160 Bitcoin H160.
TacNDJavaLib.DN_BCHAIN_HASH_RIPEMD160 RIPEMD160.
TacNDJavaLib.DN_BCHAIN_HASH_SHA256 SHA256
TacNDJavaLib.DN_BCHAIN_HASH_BTC_SHA256_2X Bitcoin SHA256 2x.
TacNDJavaLib.DN_BCHAIN_HASH_KECCAK256 KECCAK256.
pbHashHash to be signed.
strPkPrivate key identifier.
Return
Signature in the format specified in bType.
Exceptions
TacException

bchainGetPubKey()

byte[] bchainGetPubKey ( byte bType,
String jszId ) throws TacException

Recover a public key from a private key using the blockchain module.

Parameters
bTypeFormat of the public key to be exported. Can be one of the values below.
Value Meaning
TacNDJavaLib.DN_BCHAIN_PBK_SEC1_UNCOMP ECDSA SEC1 uncompressed.
TacNDJavaLib.DN_BCHAIN_PBK_SEC1_COMP ECDSA SEC1 compressed.
TacNDJavaLib.DN_BCHAIN_PBK_BIP340 Schnorr, BIP-340.
TacNDJavaLib.DN_BCHAIN_PBK_ED25519 Ed25519.
TacNDJavaLib.DN_BCHAIN_PBK_AT_ALGORAND Algorand.
TacNDJavaLib.DN_BCHAIN_PBK_BIP32_XPUB BIP32 XPub.
TacNDJavaLib.DN_BCHAIN_PBK_AT_SOL Solana.
jszIdPrivate key identifier.
Return
Public key in the format specified in bType.
Exceptions
TacException