RSA

RSA asymmetric cryptography algorithm as defined in RFC 8017.

RSA provides public-key encryption and digital signatures based on the difficulty of factoring large integers. Multiple padding schemes are available:

  • OAEP — authenticated encryption (recommended for new applications).

  • PSS — probabilistic signatures (recommended for new applications).

  • PKCS1 — legacy encryption and signatures.

  • RAW — unpadded operations (unsafe for general use).

Inheritors

Types

Link copied to clipboard

RSA with Optimal Asymmetric Encryption Padding (OAEP) as defined in RFC 8017 Section 7.1.

Link copied to clipboard
Link copied to clipboard

RSA Probabilistic Signature Scheme (PSS) as defined in RFC 8017 Section 8.1.

Link copied to clipboard

Properties

Link copied to clipboard
abstract val id: CryptographyAlgorithmId<*>

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<KP>

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.