Class SmartCardHSMCrypto
Wrapper to provide Crypto interface to SmartCard-HSM
Defined in: SmartCardHSM.js.
Constructor Attributes | Constructor Name and Description |
---|---|
SmartCardHSMCrypto(crypto)
Create crypto object implementing access to the SmartCard-HSM
|
Method Attributes | Method Name and Description |
---|---|
decrypt(key, mech, data, iv)
Decrypt a message using the defined mechanism and key
|
|
sign(key, mech, message)
Sign a message using the defined mechanism and key
|
|
verify(key, mech, message, signature)
Verify a message using the defined mechanism and key
|
Class Detail
SmartCardHSMCrypto(crypto)
Create crypto object implementing access to the SmartCard-HSM
- Parameters:
- {Crypto} crypto
- the backend crypto provider
Method Detail
{ByteString}
decrypt(key, mech, data, iv)
Decrypt a message using the defined mechanism and key
- Parameters:
- {HSMKey} key
- the private key
- {Number} mech
- the mechanism (e.g. Crypto.RSA_PKCS1)
- {ByteString} data
- the cryptogram
- {ByteString} iv
- the initialization vector for symmetric ciphers
- Returns:
- the plain text
{ByteString}
sign(key, mech, message)
Sign a message using the defined mechanism and key
- Parameters:
- {HSMKey} key
- the private key
- {Number} mech
- the mechanism (e.g. Crypto.ECDSA)
- {ByteString} message
- the message to be signed
- Returns:
- the signature
{Boolean}
verify(key, mech, message, signature)
Verify a message using the defined mechanism and key
- Parameters:
- {Key} key
- the public key
- {Number} mech
- the mechanism (e.g. Crypto.ECDSA)
- {ByteString} message
- the message to be signed
- {ByteString} signature
- the signature to verify
- Returns:
- true if signature is valid