Struct pgp::packet::SymEncryptedProtectedData
source · pub struct SymEncryptedProtectedData { /* private fields */ }
Expand description
Symmetrically Encrypted Integrity Protected Data Packet https://tools.ietf.org/html/rfc4880.html#section-5.12
Implementations§
source§impl SymEncryptedProtectedData
impl SymEncryptedProtectedData
sourcepub fn from_slice(packet_version: Version, input: &[u8]) -> Result<Self>
pub fn from_slice(packet_version: Version, input: &[u8]) -> Result<Self>
Parses a SymEncryptedData
packet from the given slice.
sourcepub fn encrypt_with_rng<R: CryptoRng + Rng>(
rng: &mut R,
alg: SymmetricKeyAlgorithm,
key: &[u8],
plaintext: &[u8]
) -> Result<Self>
pub fn encrypt_with_rng<R: CryptoRng + Rng>( rng: &mut R, alg: SymmetricKeyAlgorithm, key: &[u8], plaintext: &[u8] ) -> Result<Self>
Encrypts the data using the given symmetric key.
sourcepub fn encrypt(
alg: SymmetricKeyAlgorithm,
key: &[u8],
plaintext: &[u8]
) -> Result<Self>
pub fn encrypt( alg: SymmetricKeyAlgorithm, key: &[u8], plaintext: &[u8] ) -> Result<Self>
Same as encrypt_with_rng
, but uses thread_rng
for RNG.
pub fn data(&self) -> &[u8] ⓘ
Trait Implementations§
source§impl Clone for SymEncryptedProtectedData
impl Clone for SymEncryptedProtectedData
source§fn clone(&self) -> SymEncryptedProtectedData
fn clone(&self) -> SymEncryptedProtectedData
Returns a copy 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 Debug for SymEncryptedProtectedData
impl Debug for SymEncryptedProtectedData
source§impl From<SymEncryptedProtectedData> for Edata
impl From<SymEncryptedProtectedData> for Edata
source§fn from(other: SymEncryptedProtectedData) -> Edata
fn from(other: SymEncryptedProtectedData) -> Edata
Converts to this type from the input type.
source§impl From<SymEncryptedProtectedData> for Packet
impl From<SymEncryptedProtectedData> for Packet
source§fn from(other: SymEncryptedProtectedData) -> Packet
fn from(other: SymEncryptedProtectedData) -> Packet
Converts to this type from the input type.
source§impl PartialEq for SymEncryptedProtectedData
impl PartialEq for SymEncryptedProtectedData
source§fn eq(&self, other: &SymEncryptedProtectedData) -> bool
fn eq(&self, other: &SymEncryptedProtectedData) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<Edata> for SymEncryptedProtectedData
impl TryFrom<Edata> for SymEncryptedProtectedData
source§impl TryFrom<Packet> for SymEncryptedProtectedData
impl TryFrom<Packet> for SymEncryptedProtectedData
impl Eq for SymEncryptedProtectedData
impl StructuralPartialEq for SymEncryptedProtectedData
Auto Trait Implementations§
impl Freeze for SymEncryptedProtectedData
impl RefUnwindSafe for SymEncryptedProtectedData
impl Send for SymEncryptedProtectedData
impl Sync for SymEncryptedProtectedData
impl Unpin for SymEncryptedProtectedData
impl UnwindSafe for SymEncryptedProtectedData
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