RAW

Raw RSA without padding (textbook RSA).

Performs the raw RSA primitive without any padding scheme.

val keys = provider.get(RSA.RAW).keyPairGenerator().generateKey()
val ciphertext = keys.publicKey.encryptor().encrypt(plaintext)
val decrypted = keys.privateKey.decryptor().decrypt(ciphertext)

Unsafe for general use — prefer OAEP for encryption and PSS for signatures.

Types

Link copied to clipboard
Link copied to clipboard

A raw RSA private key that provides decryption via decryptor.

Link copied to clipboard

A raw RSA public key that provides encryption via encryptor.

Properties

Link copied to clipboard
open override val id: CryptographyAlgorithmId<RSA.RAW>

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.RAW.KeyPair>

Returns a KeyGenerator that generates RSA key pairs with the given parameters.

Link copied to clipboard

Returns a Decoder that decodes RSA private keys for the given digest from the specified PrivateKey.Format.

Link copied to clipboard

Returns a Decoder that decodes RSA public keys for the given digest from the specified PublicKey.Format.