Interface RSA_OAEP
access this type via: sec.crypto.RSA_OAEP (provides, requires or uses)
RSA-OAEP implementation, providing asymmetric encryption/decryption for a limited amount of data using RSA keys.
Constants
byte PUBLIC_KEY
byte PRIVATE_KEY
Functions
RSA_OAEP(char key_pem[], byte mode)
byte[] encrypt(byte plainText[])
byte[] decrypt(byte ciphertext[])
Constants
PUBLIC_KEY
PRIVATE_KEY
RSA_OAEP(char key_pem[], byte mode)
Create the cipher using the given key and mode. A public key must be used for encryption, and a private key for decryption.
key_pem A public or private key, encoded using base-64 PEM format.
mode Operation mode, either PUBLIC_KEY or PRIVATE_KEY.
byte[] encrypt(byte plainText[])
Encrypt plain text using a public key. The encrypted result can only be decrypted using the matching private key.
plainText The plain text to encrypt. The amount of plain text which can be encrypted is limited by the key length of the public key.
byte[] decrypt(byte ciphertext[])
Decrypt ciphertext using a private key. The private key used must be the matching key of the public key used to encrypt the data.
ciphertext The ciphertext to decrypt.