pub struct AED1 { /* private fields */ }
Expand description
Holds an AEAD encrypted data packet.
An AEAD encrypted data packet holds encrypted data. The data contains additional OpenPGP packets. See Section 5.16 of RFC 4880bis for details.
An AED packet is not normally instantiated directly. In most
cases, you’ll create one as a side-effect of encrypting a message
using the streaming serializer, or parsing an encrypted message
using the PacketParser
.
This feature is experimental. It has not been standardized and we advise users to not emit AED packets.
A note on equality
An unprocessed (encrypted) AED
packet is never considered equal
to a processed (decrypted) one. Likewise, a processed (decrypted)
packet is never considered equal to a structured (parsed) one.
Implementations
sourceimpl AED1
impl AED1
sourcepub fn new(
sym_algo: SymmetricAlgorithm,
aead: AEADAlgorithm,
chunk_size: u64,
iv: Box<[u8]>
) -> Result<Self>
pub fn new(
sym_algo: SymmetricAlgorithm,
aead: AEADAlgorithm,
chunk_size: u64,
iv: Box<[u8]>
) -> Result<Self>
Creates a new AED1 object.
sourcepub fn symmetric_algo(&self) -> SymmetricAlgorithm
pub fn symmetric_algo(&self) -> SymmetricAlgorithm
Gets the symmetric algorithm.
sourcepub fn set_symmetric_algo(
&mut self,
sym_algo: SymmetricAlgorithm
) -> SymmetricAlgorithm
pub fn set_symmetric_algo(
&mut self,
sym_algo: SymmetricAlgorithm
) -> SymmetricAlgorithm
Sets the symmetric algorithm.
sourcepub fn aead(&self) -> AEADAlgorithm
pub fn aead(&self) -> AEADAlgorithm
Gets the AEAD algorithm.
sourcepub fn set_aead(&mut self, aead: AEADAlgorithm) -> AEADAlgorithm
pub fn set_aead(&mut self, aead: AEADAlgorithm) -> AEADAlgorithm
Sets the AEAD algorithm.
sourcepub fn chunk_size(&self) -> u64
pub fn chunk_size(&self) -> u64
Gets the chunk size.
sourcepub fn set_chunk_size(&mut self, chunk_size: u64) -> Result<()>
pub fn set_chunk_size(&mut self, chunk_size: u64) -> Result<()>
Sets the chunk size.
sourcepub fn chunk_digest_size(&self) -> Result<u64>
pub fn chunk_digest_size(&self) -> Result<u64>
Gets the size of a chunk with a digest.
sourcepub fn iv(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
pub fn iv(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Gets the initialization vector for the AEAD algorithm.
sourcepub fn set_iv(&mut self, iv: Box<[u8]>) -> Box<[u8]>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
pub fn set_iv(&mut self, iv: Box<[u8]>) -> Box<[u8]>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
Sets the initialization vector for the AEAD algorithm.
Methods from Deref<Target = Container>
sourcepub fn children_ref(&self) -> Option<&[Packet]>
pub fn children_ref(&self) -> Option<&[Packet]>
Returns a reference to this Packet’s children.
Returns None
if the body is not structured.
sourcepub fn children_mut(&mut self) -> Option<&mut Vec<Packet>>
pub fn children_mut(&mut self) -> Option<&mut Vec<Packet>>
Returns a mutable reference to this Packet’s children.
Returns None
if the body is not structured.
sourcepub fn descendants(&self) -> Option<Iter<'_>>
pub fn descendants(&self) -> Option<Iter<'_>>
Returns an iterator over the packet’s descendants. The descendants are visited in depth-first order.
Returns None
if the body is not structured.
Trait Implementations
sourceimpl Marshal for AED1
impl Marshal for AED1
sourceimpl MarshalInto for AED1
impl MarshalInto for AED1
sourcefn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
Computes the maximal length of the serialized representation. Read more
sourcefn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
Serializes into the given buffer. Read more
impl Eq for AED1
impl StructuralEq for AED1
impl StructuralPartialEq for AED1
Auto Trait Implementations
impl RefUnwindSafe for AED1
impl Send for AED1
impl Sync for AED1
impl Unpin for AED1
impl UnwindSafe for AED1
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more