PKCS1

RSA with PKCS#1 v1.5 padding as defined in RFC 8017 Sections 7.2 and 8.2.

Provides both encryption and digital signatures using the legacy PKCS#1 v1.5 padding scheme.

val keys = provider.get(RSA.PKCS1).keyPairGenerator().generateKey()
val signature = keys.privateKey.signatureGenerator().generateSignature(data)
keys.publicKey.signatureVerifier().verifySignature(data, signature)

Prefer OAEP for encryption and PSS for signatures in new applications.

Types

Link copied to clipboard
Link copied to clipboard

An RSA-PKCS1 private key that provides signature generation via signatureGenerator and decryption via decryptor.

Link copied to clipboard

An RSA-PKCS1 public key that provides signature verification via signatureVerifier and 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.PKCS1.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.