Skip to main content

Crate pkcs1

Crate pkcs1 

Source
Expand description

§RustCrypto: PKCS#1 (RSA)

crate Docs Build Status Apache2/MIT licensed Rust Version Project Chat

Pure Rust implementation of Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.2 (RFC 8017).

Documentation

§About

This crate supports encoding and decoding RSA private and public keys in either PKCS#1 DER (binary) or PEM (text) formats.

PEM encoded RSA private keys begin with:

-----BEGIN RSA PRIVATE KEY-----

PEM encoded RSA public keys begin with:

-----BEGIN RSA PUBLIC KEY-----

§Minimum Supported Rust Version (MSRV) Policy

MSRV increases are not considered breaking changes and can happen in patch releases.

The crate MSRV accounts for all supported targets and crate feature combinations, excluding explicitly unstable features.

§License

Licensed under either of:

at your option.

§Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Re-exports§

pub use der;
pub use der::pem;

Modules§

error 🔒
Error types
params 🔒
PKCS#1 RSA parameters.
private_key 🔒
PKCS#1 RSA Private Keys.
public_key 🔒
PKCS#1 RSA Public Keys.
traits 🔒
Traits for parsing objects from PKCS#1 encoded documents
version 🔒
PKCS#1 version identifier.

Structs§

ObjectIdentifier
Object identifier (OID).
OtherPrimeInfo
PKCS#1 OtherPrimeInfo as defined in RFC 8017 Appendix 1.2.
RsaOaepParams
PKCS#1 RSAES-OAEP parameters as defined in RFC 8017 Appendix 2.1
RsaPrivateKey
PKCS#1 RSA Private Keys as defined in RFC 8017 Appendix 1.2.
RsaPssParams
PKCS#1 RSASSA-PSS parameters as defined in RFC 8017 Appendix 2.3
RsaPublicKey
PKCS#1 RSA Public Keys as defined in RFC 8017 Appendix 1.1.
UintRef
Unsigned arbitrary precision ASN.1 INTEGER reference type.

Enums§

Error
Error type
LineEnding
Line endings: variants of newline characters that can be used with Base64.
TrailerField
TrailerField as defined in RFC 8017 Appendix 2.3.
Version
Version identifier for PKCS#1 documents as defined in RFC 8017 Appendix 1.2.

Constants§

ALGORITHM_ID
AlgorithmIdentifier for RSA.
ALGORITHM_OID
rsaEncryption Object Identifier (OID)

Traits§

DecodeRsaPrivateKey
Parse an RsaPrivateKey from a PKCS#1-encoded document.
DecodeRsaPublicKey
Parse a RsaPublicKey from a PKCS#1-encoded document.
EncodeRsaPrivateKey
Serialize a RsaPrivateKey to a PKCS#1 encoded document.
EncodeRsaPublicKey
Serialize a RsaPublicKey to a PKCS#1-encoded document.

Type Aliases§

OtherPrimeInfos
Additional RSA prime info in a multi-prime RSA key.
Result
Result type
RsaOaepParamsOwned
RsaOaepParams with allocating AlgorithmIdentifier<Any>
RsaOaepParamsRef
RsaOaepParams with AlgorithmIdentifier<AnyRef>
RsaPrivateKeyOwned
PKCS#1 RSA Private Keys as defined in [RFC 8017 Appendix 1.2].
RsaPrivateKeyRef
PKCS#1 RSA Private Keys as defined in [RFC 8017 Appendix 1.2].
RsaPssParamsOwned
PKCS#1 RSASSA-PSS parameters as defined in [RFC 8017 Appendix 2.3]
RsaPssParamsRef
PKCS#1 RSASSA-PSS parameters as defined in [RFC 8017 Appendix 2.3]
RsaPublicKeyOwned
RsaPublicKey with allocating Uint INTEGERs.
RsaPublicKeyRef
RsaPublicKey with UintRef INTEGERs.