pub struct EncryptedPrivateKeyInfo<Data> {
pub encryption_algorithm: EncryptionScheme,
pub encrypted_data: Data,
}Available on crate feature
pkcs5 only.Expand description
PKCS#8 EncryptedPrivateKeyInfo.
ASN.1 structure containing a PKCS#5 EncryptionScheme identifier for a
password-based symmetric encryption scheme and encrypted private key data.
§Schema
Structure described in RFC 5208 Section 6:
EncryptedPrivateKeyInfo ::= SEQUENCE {
encryptionAlgorithm EncryptionAlgorithmIdentifier,
encryptedData EncryptedData }
EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
EncryptedData ::= OCTET STRINGFields§
§encryption_algorithm: EncryptionSchemeAlgorithm identifier describing a password-based symmetric encryption
scheme used to encrypt the encrypted_data field.
encrypted_data: DataPrivate key data
Implementations§
Source§impl<'a, Data> EncryptedPrivateKeyInfo<Data>
impl<'a, Data> EncryptedPrivateKeyInfo<Data>
Sourcepub fn decrypt(&self, password: impl AsRef<[u8]>) -> Result<SecretDocument>
Available on crate feature encryption only.
pub fn decrypt(&self, password: impl AsRef<[u8]>) -> Result<SecretDocument>
encryption only.Attempt to decrypt this encrypted private key using the provided password to derive an encryption key.
§Errors
- Returns errors in the event the file could not be decrypted successfully.
- Returns errors if the file decrypted but the resulting plaintext failed to decode.
Trait Implementations§
Source§impl<Data: Clone> Clone for EncryptedPrivateKeyInfo<Data>
impl<Data: Clone> Clone for EncryptedPrivateKeyInfo<Data>
Source§fn clone(&self) -> EncryptedPrivateKeyInfo<Data>
fn clone(&self) -> EncryptedPrivateKeyInfo<Data>
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 moreSource§impl<Data> Debug for EncryptedPrivateKeyInfo<Data>
impl<Data> Debug for EncryptedPrivateKeyInfo<Data>
Source§impl<'a, Data> DecodeValue<'a> for EncryptedPrivateKeyInfo<Data>
impl<'a, Data> DecodeValue<'a> for EncryptedPrivateKeyInfo<Data>
Source§impl<Data> EncodeValue for EncryptedPrivateKeyInfo<Data>where
Data: EncodeValue + FixedTag,
impl<Data> EncodeValue for EncryptedPrivateKeyInfo<Data>where
Data: EncodeValue + FixedTag,
Source§impl<Data: PartialEq> PartialEq for EncryptedPrivateKeyInfo<Data>
impl<Data: PartialEq> PartialEq for EncryptedPrivateKeyInfo<Data>
Source§fn eq(&self, other: &EncryptedPrivateKeyInfo<Data>) -> bool
fn eq(&self, other: &EncryptedPrivateKeyInfo<Data>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<Data> PemLabel for EncryptedPrivateKeyInfo<Data>
Available on crate feature pem only.
impl<Data> PemLabel for EncryptedPrivateKeyInfo<Data>
Available on crate feature
pem only.Source§impl<'a, Data> TryFrom<&'a [u8]> for EncryptedPrivateKeyInfo<Data>
impl<'a, Data> TryFrom<&'a [u8]> for EncryptedPrivateKeyInfo<Data>
Source§impl<'a, Data> TryFrom<&EncryptedPrivateKeyInfo<Data>> for SecretDocument
Available on crate feature alloc only.
impl<'a, Data> TryFrom<&EncryptedPrivateKeyInfo<Data>> for SecretDocument
Available on crate feature
alloc only.Source§fn try_from(
encrypted_private_key: &EncryptedPrivateKeyInfo<Data>,
) -> Result<SecretDocument>
fn try_from( encrypted_private_key: &EncryptedPrivateKeyInfo<Data>, ) -> Result<SecretDocument>
Performs the conversion.
Source§impl<'a, Data> TryFrom<EncryptedPrivateKeyInfo<Data>> for SecretDocument
Available on crate feature alloc only.
impl<'a, Data> TryFrom<EncryptedPrivateKeyInfo<Data>> for SecretDocument
Available on crate feature
alloc only.Source§fn try_from(
encrypted_private_key: EncryptedPrivateKeyInfo<Data>,
) -> Result<SecretDocument>
fn try_from( encrypted_private_key: EncryptedPrivateKeyInfo<Data>, ) -> Result<SecretDocument>
Performs the conversion.
impl<Data: Eq> Eq for EncryptedPrivateKeyInfo<Data>
impl<'a, Data> Sequence<'a> for EncryptedPrivateKeyInfo<Data>
impl<Data> StructuralPartialEq for EncryptedPrivateKeyInfo<Data>
Auto Trait Implementations§
impl<Data> Freeze for EncryptedPrivateKeyInfo<Data>where
Data: Freeze,
impl<Data> RefUnwindSafe for EncryptedPrivateKeyInfo<Data>where
Data: RefUnwindSafe,
impl<Data> Send for EncryptedPrivateKeyInfo<Data>where
Data: Send,
impl<Data> Sync for EncryptedPrivateKeyInfo<Data>where
Data: Sync,
impl<Data> Unpin for EncryptedPrivateKeyInfo<Data>where
Data: Unpin,
impl<Data> UnsafeUnpin for EncryptedPrivateKeyInfo<Data>where
Data: UnsafeUnpin,
impl<Data> UnwindSafe for EncryptedPrivateKeyInfo<Data>where
Data: 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag + 'a,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag + 'a,
Source§type Error = <T as DecodeValue<'a>>::Error
type Error = <T as DecodeValue<'a>>::Error
Type returned in the event of a decoding error.
Source§fn decode<R>(reader: &mut R) -> Result<T, <T as DecodeValue<'a>>::Error>where
R: Reader<'a>,
fn decode<R>(reader: &mut R) -> Result<T, <T as DecodeValue<'a>>::Error>where
R: Reader<'a>,
Attempt to decode this TLV message using the provided decoder. Read more
Source§impl<T> Encode for T
impl<T> Encode for T
Source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this TLV object in bytes when encoded as ASN.1 DER. Read more
Source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this TLV object to the provided byte slice, returning a sub-slice
containing the encoded message. Read more
Source§impl<T> IsConstructed for T
impl<T> IsConstructed for T
Source§const CONSTRUCTED: bool
const CONSTRUCTED: bool
ASN.1 constructed bit