1 #![no_std] 2 #![cfg_attr(docsrs, feature(doc_auto_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)] 9 #![warn( 10 clippy::mod_module_files, 11 clippy::unwrap_used, 12 missing_docs, 13 rust_2018_idioms, 14 unused_lifetimes, 15 unused_qualifications 16 )] 17 18 /// Local Android change: Use std to allow building as a dylib. 19 #[cfg(android_dylib)] 20 extern crate std; 21 22 #[cfg(feature = "alloc")] 23 extern crate alloc; 24 #[cfg(feature = "std")] 25 extern crate std; 26 27 mod error; 28 mod params; 29 mod private_key; 30 mod public_key; 31 mod traits; 32 mod version; 33 34 pub use der::{ 35 self, 36 asn1::{ObjectIdentifier, UintRef}, 37 }; 38 39 pub use crate::{ 40 error::{Error, Result}, 41 params::{RsaOaepParams, RsaPssParams, TrailerField}, 42 private_key::RsaPrivateKey, 43 public_key::RsaPublicKey, 44 traits::{DecodeRsaPrivateKey, DecodeRsaPublicKey}, 45 version::Version, 46 }; 47 48 #[cfg(feature = "alloc")] 49 pub use crate::{ 50 private_key::{other_prime_info::OtherPrimeInfo, OtherPrimeInfos}, 51 traits::{EncodeRsaPrivateKey, EncodeRsaPublicKey}, 52 }; 53 54 #[cfg(feature = "pem")] 55 pub use der::pem::{self, LineEnding}; 56 57 /// `rsaEncryption` Object Identifier (OID) 58 #[cfg(feature = "pkcs8")] 59 pub const ALGORITHM_OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.2.840.113549.1.1.1"); 60 61 /// `AlgorithmIdentifier` for RSA. 62 #[cfg(feature = "pkcs8")] 63 pub const ALGORITHM_ID: pkcs8::AlgorithmIdentifierRef<'static> = pkcs8::AlgorithmIdentifierRef { 64 oid: ALGORITHM_OID, 65 parameters: Some(der::asn1::AnyRef::NULL), 66 }; 67