pkcs1/
lib.rs

1#![no_std]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3#![doc = include_str!("../README.md")]
4#![doc(
5    html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
6    html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
7)]
8#![forbid(unsafe_code, clippy::unwrap_used)]
9#![warn(missing_docs, rust_2018_idioms, unused_qualifications)]
10
11#[cfg(feature = "alloc")]
12extern crate alloc;
13#[cfg(feature = "std")]
14extern crate std;
15
16mod error;
17mod params;
18mod private_key;
19mod public_key;
20mod traits;
21mod version;
22
23pub use der::{
24    self,
25    asn1::{ObjectIdentifier, UIntRef},
26};
27
28pub use crate::{
29    error::{Error, Result},
30    params::{RsaOaepParams, RsaPssParams, TrailerField},
31    private_key::RsaPrivateKey,
32    public_key::RsaPublicKey,
33    traits::{DecodeRsaPrivateKey, DecodeRsaPublicKey},
34    version::Version,
35};
36
37#[cfg(feature = "alloc")]
38pub use crate::{
39    private_key::{other_prime_info::OtherPrimeInfo, OtherPrimeInfos},
40    traits::{EncodeRsaPrivateKey, EncodeRsaPublicKey},
41};
42
43#[cfg(feature = "pem")]
44#[cfg_attr(docsrs, doc(cfg(feature = "pem")))]
45pub use der::pem::{self, LineEnding};
46
47/// `rsaEncryption` Object Identifier (OID)
48#[cfg(feature = "pkcs8")]
49#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))]
50pub const ALGORITHM_OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.2.840.113549.1.1.1");
51
52/// `AlgorithmIdentifier` for RSA.
53#[cfg(feature = "pkcs8")]
54#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))]
55pub const ALGORITHM_ID: pkcs8::AlgorithmIdentifier<'static> = pkcs8::AlgorithmIdentifier {
56    oid: ALGORITHM_OID,
57    parameters: Some(der::asn1::AnyRef::NULL),
58};