How rustcrypto/rsa works
This is RustCrypto RSA, a pure-Rust RSA cryptography library. Its main workflow creates or imports a key pair, then uses public-key encryption/private-key decryption or signing/verification APIs. The graph distinguishes OAEP and PKCS#1 v1.5 encryption from PKCS#1 v1.5 and PSS signatures, with key management and the shared RSA primitive as internal layers. README and the tree support the product capabilities; some subsystem wiring is inferred only where documented, so uncertain calls are omitted.
Main entry points: rsa.rs RSA operations · key.rs Key management · encrypting_key.rs OAEP encrypt · decrypting_key.rs OAEP decrypt
Components 21
RSA keys
- Key management
src/key.rs - Prime and key generation
src/algorithms/generate.rs - Key component traits
src/traits/keys.rs
Encryption
- Encryption APIs
src/traits/encryption.rs - OAEP encrypt
src/oaep/encrypting_key.rs - OAEP decrypt
src/oaep/decrypting_key.rs - OAEP encoding
src/algorithms/oaep.rs - PKCS1v15 encrypt
src/pkcs1v15/encrypting_key.rs - PKCS1v15 decrypt
src/pkcs1v15/decrypting_key.rs - Padding algorithms
src/algorithms/pad.rs
Signatures
- PKCS1v15 signing
src/pkcs1v15/signing_key.rs - PKCS1v15 verification
src/pkcs1v15/verifying_key.rs - PSS signing
src/pss/signing_key.rs - Blinded PSS signing
src/pss/blinded_signing_key.rs - PSS verification
src/pss/verifying_key.rs - PSS encoding
src/algorithms/pss.rs
Core and encoding
- RSA operations
src/algorithms/rsa.rs - Key encoding
src/encoding.rs - Crate API
src/lib.rs
Other components
- Library caller
- Random generator
Connections 33
- Library caller → Crate API: uses
- Crate API → Key management: exposes
- Library caller → Key management: creates keys
- Key management → Prime and key generation: generates
- Random generator → Prime and key generation: provides randomness
- Key management → Key component traits: implements
- Library caller → OAEP encrypt: encrypts with
- Library caller → OAEP decrypt: decrypts with
- Library caller → PKCS1v15 encrypt: encrypts with
- Library caller → PKCS1v15 decrypt: decrypts with
- OAEP encrypt → OAEP encoding: encodes
- OAEP decrypt → OAEP encoding: decodes
- PKCS1v15 encrypt → Padding algorithms: pads
- PKCS1v15 decrypt → Padding algorithms: unpads
- OAEP encrypt → RSA operations: uses public operation
- OAEP decrypt → RSA operations: uses private operation
- PKCS1v15 encrypt → RSA operations: uses public operation
- PKCS1v15 decrypt → RSA operations: uses private operation
- Library caller → PKCS1v15 signing: signs with
- Library caller → PKCS1v15 verification: verifies with
- Library caller → PSS signing: signs with
- Library caller → Blinded PSS signing: signs with
- Library caller → PSS verification: verifies with
- PKCS1v15 signing → RSA operations: signs via
- PKCS1v15 verification → RSA operations: verifies via
- PSS signing → PSS encoding: encodes
- Blinded PSS signing → PSS encoding: encodes
- PSS verification → PSS encoding: checks encoding
- PSS signing → RSA operations: signs via
- Blinded PSS signing → RSA operations: signs via
- PSS verification → RSA operations: verifies via
- Library caller → Key encoding: imports or exports keys
- Key encoding → Key management: converts keys