pub struct RsaKey<T> { /* private fields */ }Expand description
An RSA private key for rsa-sha256 signing (RFC 6376 Section 3.3.2).
T selects the hash function; only RsaKey<Sha256> implements
SigningKey. Load a key with from_key_der.
Implementations§
Source§impl<T: HashImpl> RsaKey<T>
impl<T: HashImpl> RsaKey<T>
Sourcepub fn from_pkcs8_pem(pkcs8_pem: &str) -> Result<Self>
👎Deprecated since 0.7.4: use from_key_der() instead
pub fn from_pkcs8_pem(pkcs8_pem: &str) -> Result<Self>
use from_key_der() instead
Loads an RSA private key from a PKCS #8 PEM string.
§Errors
Returns Error::Crypto with CryptoError::Library if the key
cannot be decoded.
Sourcepub fn from_pkcs8_der(pkcs8_der: &[u8]) -> Result<Self>
👎Deprecated since 0.7.4: use from_key_der() instead
pub fn from_pkcs8_der(pkcs8_der: &[u8]) -> Result<Self>
use from_key_der() instead
Loads an RSA private key from PKCS #8 DER bytes.
§Errors
Returns Error::Crypto with CryptoError::Library if the key
cannot be decoded.
Sourcepub fn from_rsa_pem(rsa_pem: &str) -> Result<Self>
👎Deprecated since 0.7.4: use from_key_der() instead
pub fn from_rsa_pem(rsa_pem: &str) -> Result<Self>
use from_key_der() instead
Loads an RSA private key from a PKCS #1 PEM string
(BEGIN RSA PRIVATE KEY).
§Errors
Returns Error::Crypto with CryptoError::Library if the key
cannot be decoded.
Sourcepub fn from_der(der: &[u8]) -> Result<Self>
👎Deprecated since 0.7.4: use from_key_der() instead
pub fn from_der(der: &[u8]) -> Result<Self>
use from_key_der() instead
Loads an RSA private key from PKCS #1 DER bytes.
§Errors
Returns Error::Crypto with CryptoError::Library if the key
cannot be decoded.
Sourcepub fn from_key_der(key_der: PrivateKeyDer<'_>) -> Result<Self>
pub fn from_key_der(key_der: PrivateKeyDer<'_>) -> Result<Self>
Loads an RSA private key from DER, in PKCS #1 (RSAPrivateKey) or
PKCS #8 (PrivateKeyInfo) form. Parse PEM input first with
PrivateKeyDer::from_pem_slice.
§Errors
Returns Error::Crypto with CryptoError::Library if the key is
in another format (such as SEC1) or cannot be decoded.
Sourcepub fn public_key(&self) -> Vec<u8> ⓘ
pub fn public_key(&self) -> Vec<u8> ⓘ
Returns the public key of the RSA key pair, encoded as a DER PKCS #1
RSAPublicKey.
Trait Implementations§
Source§impl From<RsaKey<Sha256>> for DkimKey
Available on crate features aws-lc-rs or rust-crypto only.
impl From<RsaKey<Sha256>> for DkimKey
aws-lc-rs or rust-crypto only.Source§impl SigningKey for RsaKey<Sha256>
impl SigningKey for RsaKey<Sha256>
Source§fn sign(&self, input: impl Writable) -> Result<Vec<u8>>
fn sign(&self, input: impl Writable) -> Result<Vec<u8>>
input and returns the raw signature. Read moreSource§fn heap_size(&self) -> usize
fn heap_size(&self) -> usize
Source§fn hash(&self, data: impl Writable) -> HashOutput
fn hash(&self, data: impl Writable) -> HashOutput
data with Self::Hasher.Auto Trait Implementations§
impl<T> Freeze for RsaKey<T>where
PhantomData<T>: Freeze,
impl<T> RefUnwindSafe for RsaKey<T>where
PhantomData<T>: RefUnwindSafe,
impl<T> Send for RsaKey<T>where
PhantomData<T>: Send,
impl<T> Sync for RsaKey<T>where
PhantomData<T>: Sync,
impl<T> Unpin for RsaKey<T>where
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for RsaKey<T>where
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for RsaKey<T>where
PhantomData<T>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more