Signatures
Signing
Create Cryptographic Signature
Signs data using a cryptographic key. This function requires inputs as follows:
Data
1 : Byte array, data that will be signed.Private Key (PEM)
2 : Byte array, private key encoded asPEM
.
There is also two additional optional inputs:
Password
3 : UTF-8 String, pass-phrase used to decrypt the private key (should stay empty if the key is not encrypted).Message Digest
4 : Enumeration, the digest algorithm used in the process of signing.Default
will use the default algorithm associated with the key type.
If successful, returns byte array containing the calculated signature 5.
Verifying
Verify Cryptographic Signature
Verifies a cryptographic signature against the data that was signed.
This function requires inputs as follows:
Signature
1 : Byte array, the signature that will be verified.Data
2 : Byte array, data that was signed with.Key (PEM)
3 : Byte array, key encoded asPEM
(By default, verification keys are expected to be public).
There is also three additional optional inputs:
Is Private
4 : Boolean, if true,Key (PEM)
will be treated as a private key.Password
5 : UTF-8 String, pass-phrase used to decrypt the private key (should stay empty if the key is not encrypted, or when verifying by a public key).Message Digest
6 : Enumeration, the digest algorithm used in the process of signing.Default
will use the default algorithm associated with the key type.
If successful, returns a boolean value that indicates whether the signature 1 is valid 7.