Sign and Sign Verify
The Sign operation is a bit different from the other operations offered by the CADP for Java provider.
How it works
A digital signature is created by taking a message or a pre-calculated hash.
Encrypt the message or pre-calculated hash with the sender's private key.
The message and the digital signature are then sent to the recipient.
The recipient verifies the digital signature using the sender's public key.
Important Notes
Sign and verify operations only work in remote mode.
Sign and verify operations do not apply to KMIP sessions; however, the keys created in KMIP session can be used in signing/verifying.
It is not recommended to use SHA1 for signing purpose.
For versioned keys, the verify operation fails when data length is greater than 2047 bytes.
The saltLength parameter will only work with the following algorithms:
SHA1withRSAPSSPadding
SHA256withRSAPSSPadding
SHA384withRSAPSSPadding
SHA512withRSAPSSPadding
RSAPSSPaddingSHA1
RSAPSSPaddingSHA256
RRSAPSSPaddingSHA384
RSAPSSPaddingSHA512
The signature object must be initialized to use the saltLength parameter.
You can not exceed the maximum saltLength defined for a key and algorithm pair. Use the following formula to calculate the maximum saltLength:
Max saltlength = Key size in Byte- HASH Value of Algo - 2
Refer to supported algorithms to view the list of algorithms used for sign/verify.
In this article you will learn how to :