Signature and Verification
- Create a digital signature. The CA delivers the CMD_SIGN_PSS_MGF1_SHA256 command to the TA, and the TA executes the command to perform the following functions:
- Generate a message digest: Before a message is signed, the message digest is calculated using the SHA256 algorithm.
- Encrypt the message digest using RSA: The private key is used to encrypt the message digest and generate a digital signature.
Figure 1 Code execution process of generating an RSA signature
- Verify the digital signature. The CA delivers the CMD_VERIFY_PSS_MGF1_SHA256 command, and the TA executes the command to perform the following functions:
- Decrypt the signature: The signature value is the message digest encrypted using RSA. The public key is used to decrypt the message digest.
- Verify the signature: The message digest is calculated and compared with the original one to verify the message integrity and the signer identity.
Figure 2 Code execution process of RSA signature verification
Parent topic: Features