std.x.crypto.rsa [x] std.x.crypto.rsa.PublicKey pub struct PublicKey { modulus: List[byte], exponent: List[byte], bits: int, } — An RSA public key (RFC 8017 §3.1): the modulus n and the public exponent e as minimal big-endian bytes, and n's length in bits. std.x.crypto.rsa.hash_sha256 pub fn hash_sha256() -> int — The SHA-256 selector for verify_pkcs1 and verify_pss: its digest size in bits. std.x.crypto.rsa.hash_sha384 pub fn hash_sha384() -> int — The SHA-384 selector. std.x.crypto.rsa.hash_sha512 pub fn hash_sha512() -> int — The SHA-512 selector. std.x.crypto.rsa.public_key pub fn public_key(modulus: List[byte], exponent: List[byte]) -> PublicKey ! { small_modulus, large_modulus, bad_modulus, bad_exponent, } — An RSA public key from its modulus and exponent as big-endian bytes (leading zero octets allowed and dropped), under the module's policy. std.x.crypto.rsa.parse_public_key pub fn parse_public_key(der_bytes: List[byte]) -> PublicKey ! { der, small_modulus, large_modulus, bad_modulus, bad_exponent, } — An RSA public key from its DER RSAPublicKey (RFC 8017 A.1.1: SEQUENCE { modulus INTEGER, publicExponent INTEGER }) — the content of an X.509 rsaEncryption SubjectPublicKeyInfo's BIT STRING. std.x.crypto.rsa.verify_pkcs1 pub fn verify_pkcs1(key: PublicKey, hash: int, message: List[byte], sig: List[byte]) -> bool — RSASSA-PKCS1-V1_5-VERIFY (RFC 8017 §8.2.2): true iff sig is the signature of message under key with the selected hash. std.x.crypto.rsa.verify_pss pub fn verify_pss( key: PublicKey, hash: int, message: List[byte], sig: List[byte], salt_len: int, ) -> bool — RSASSA-PSS-VERIFY (RFC 8017 §8.1.2, EMSA-PSS §9.1.2): true iff sig is a PSS signature of message under key, with MGF1 over the selected hash and a salt of exactly salt_len octets. std.x.crypto.rsa.to_hex pub fn to_hex(b: List[byte]) -> str — Lowercase hex of a byte list.