ddn.crypto.key.rsa
RSA Keys, Primitives, and Key Generator.
Side-Channel Resistance: This module provides RSA blinding for private key operations to prevent timing side-channel attacks. Use rsaDpBlinded instead of rsaDp for security-critical applications.
Types 3
classRSAPublicKey : PublicKey
RSA Public Key.
Methods
size_t toHash() constclassRSAPrivateKey : PrivateKey
RSA Private Key.
Methods
size_t toHash() constMethods
KeyPair generateKeyPair()Generates a new RSA key pair using the stored parameters.Functions 13
fn
ubyte[] encodeRsaSpki(RSAPublicKey key)Encodes an RSA public key as a DER-encoded SubjectPublicKeyInfo (SPKI).fn
RSAPublicKey decodeRsaSpki(const(ubyte)[] der)Decodes an RSA public key from DER-encoded SubjectPublicKeyInfo (SPKI).fn
ubyte[] encodeRsaPkcs8(RSAPrivateKey key)Encodes an RSA private key in PKCS#8 format (PrivateKeyInfo).fn
RSAPrivateKey decodeRsaPkcs8(const(ubyte)[] der)Decodes an RSA private key from PKCS#8 format (PrivateKeyInfo).fn
BigInt modInverse(BigInt a, BigInt n)fn
BigInt rsaEp(RSAPublicKey key, BigInt m)fn
BigInt rsaDpBlinded(RSAPrivateKey key, BigInt c, Random random)RSA decryption primitive with blinding for side-channel resistance.