Struct PrivateDecryptingKey
pub struct PrivateDecryptingKey(/* private fields */);Expand description
An RSA private key used for decrypting ciphertext encrypted by a PublicEncryptingKey.
Implementations§
§impl PrivateDecryptingKey
impl PrivateDecryptingKey
pub fn generate(size: KeySize) -> Result<PrivateDecryptingKey, Unspecified>
pub fn generate(size: KeySize) -> Result<PrivateDecryptingKey, Unspecified>
Generate a new RSA private key pair for use with asymmetrical encryption.
Supports the following key sizes:
KeySize::Rsa2048KeySize::Rsa3072KeySize::Rsa4096KeySize::Rsa8192
§Errors
Unspecifiedfor any error that occurs during the generation of the RSA keypair.
pub fn from_pkcs8(pkcs8: &[u8]) -> Result<PrivateDecryptingKey, KeyRejected>
pub fn from_pkcs8(pkcs8: &[u8]) -> Result<PrivateDecryptingKey, KeyRejected>
Construct a PrivateDecryptingKey from the provided PKCS#8 (v1) document.
Supports RSA key sizes between 2048 and 8192 (inclusive).
§Errors
Unspecifiedfor any error that occurs during deserialization of this key from PKCS#8.
pub fn key_size_bytes(&self) -> usize
pub fn key_size_bytes(&self) -> usize
Returns the RSA signature size in bytes.
pub fn key_size_bits(&self) -> usize
pub fn key_size_bits(&self) -> usize
Returns the RSA key size in bits.
pub fn public_key(&self) -> PublicEncryptingKey
pub fn public_key(&self) -> PublicEncryptingKey
Retrieves the PublicEncryptingKey corresponding with this PrivateDecryptingKey.
Trait Implementations§
§impl AsDer<Pkcs8V1Der<'static>> for PrivateDecryptingKey
impl AsDer<Pkcs8V1Der<'static>> for PrivateDecryptingKey
§fn as_der(&self) -> Result<Pkcs8V1Der<'static>, Unspecified>
fn as_der(&self) -> Result<Pkcs8V1Der<'static>, Unspecified>
Serializes into a DER format. Read more
§impl Clone for PrivateDecryptingKey
impl Clone for PrivateDecryptingKey
§fn clone(&self) -> PrivateDecryptingKey
fn clone(&self) -> PrivateDecryptingKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PrivateDecryptingKey
impl RefUnwindSafe for PrivateDecryptingKey
impl !Send for PrivateDecryptingKey
impl !Sync for PrivateDecryptingKey
impl Unpin for PrivateDecryptingKey
impl UnwindSafe for PrivateDecryptingKey
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
Converts
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> ⓘ
Converts
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more