Interface RSA_PSS
access this type via: sec.crypto.RSA_PSS (provides, requires or uses)
RSA-PSS implementation, providing asymmetric signing/verification using RSA keys. This is generally used to verify that the sender of a message is authentic. Assuming that the sender's public key is held at the receiver, the sender can sign a message using their private key and the receiver can verify that the signed message can only have been signed by a private key matching a given public key.
Constants
byte PUBLIC_KEY
byte PRIVATE_KEY
Functions
RSA_PSS(char key_pem[], byte mode)
byte[] sign(byte plaintext[])
bool verify(byte plaintext[], byte signedtext[])
Constants
PUBLIC_KEY
PRIVATE_KEY
RSA_PSS(char key_pem[], byte mode)
Create the cipher using the given key and mode. A private key must be used for signing, and a public key for verification.
key_pem A public or private key, encoded using base-64 PEM format.
mode Operation mode, either PUBLIC_KEY or PRIVATE_KEY.
byte[] sign(byte plaintext[])
Sign a piece of plain text using a private key. Internally the plain text is first hashed to a fixed-length, with the hashed value signed.
plaintext The plain text to sign.
bool verify(byte plaintext[], byte signedtext[])
Verify the signature, derived from the given piece of plain text, was signed using a private key that matches our public key.
plaintext The plain text that was signed using the sign function.
signedtext The signature that was returned from the sign function.