OAEP
RSA with Optimal Asymmetric Encryption Padding (OAEP) as defined in RFC 8017 Section 7.1.
Provides asymmetric encryption with support for associated data (labels).
val keys = provider.get(RSA.OAEP).keyPairGenerator().generateKey()
val ciphertext = keys.publicKey.encryptor().encrypt(plaintext)
val decrypted = keys.privateKey.decryptor().decrypt(ciphertext)Content copied to clipboard
Types
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
An RSA-OAEP private key that provides decryption via decryptor.
Link copied to clipboard
An RSA-OAEP public key that provides encryption via encryptor.
Properties
Link copied to clipboard
The typed identifier that uniquely distinguishes this algorithm and is used to look it up from a CryptographyProvider.
Functions
Link copied to clipboard
abstract fun keyPairGenerator(keySize: BinarySize = 4096.bits, digest: CryptographyAlgorithmId<Digest> = SHA512, publicExponent: BigInt = 65537.toBigInt()): KeyGenerator<RSA.OAEP.KeyPair>
Returns a KeyGenerator that generates RSA key pairs with the given parameters.
Link copied to clipboard
abstract fun privateKeyDecoder(digest: CryptographyAlgorithmId<Digest>): Decoder<RSA.PrivateKey.Format, RSA.OAEP.PrivateKey>
Returns a Decoder that decodes RSA private keys for the given digest from the specified PrivateKey.Format.
Link copied to clipboard
abstract fun publicKeyDecoder(digest: CryptographyAlgorithmId<Digest>): Decoder<RSA.PublicKey.Format, RSA.OAEP.PublicKey>
Returns a Decoder that decodes RSA public keys for the given digest from the specified PublicKey.Format.