[][src]Trait sequoia_openpgp::serialize::Serialize

pub trait Serialize {
    fn serialize<W: Write>(&self, o: &mut W) -> Result<()>;

    fn to_vec(&self) -> Result<Vec<u8>> { ... }
}

Packet serialization.

This interfaces serializes packets and packet trees.

Required methods

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>

Writes a serialized version of the packet to o.

Loading content...

Provided methods

fn to_vec(&self) -> Result<Vec<u8>>

Serializes the packet to a vector.

Loading content...

Implementors

impl Serialize for Ciphertext[src]

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for PublicKey[src]

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for SecretKey[src]

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for sequoia_openpgp::crypto::mpis::Signature[src]

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for S2K[src]

fn serialize<W: Write>(&self, w: &mut W) -> Result<()>[src]

Serializes this S2K instance.

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for KeyID[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified KeyID to o.

fn to_vec(&self) -> Result<Vec<u8>>[src]

Serializes the packet to a vector.

impl Serialize for Packet[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified Packet to o.

This function works recursively: if the packet contains any packets, they are also serialized.

fn to_vec(&self) -> Result<Vec<u8>>[src]

Serializes the packet to a vector.

impl Serialize for CTB[src]

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for BodyLength[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Emits the length encoded for use with new-style CTBs.

Note: the CTB itself is not emitted.

Errors

Returns Error::InvalidArgument if invoked on BodyLength::Indeterminate. If you want to serialize an old-style length, use serialize_old(..).

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for SKESK[src]

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for MPI[src]

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for CTBNew[src]

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for CTBOld[src]

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for sequoia_openpgp::packet::signature::Signature[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified Signature packet to o.

Note: this function does not compute the signature (which would require access to the private key); it assumes that sig.mpis is up to date.

Errors

Returns Error::InvalidArgument if invoked on a non-version 4 signature, or if either the hashed-area or the unhashed-area exceeds the size limit of 2^16.

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for AED[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified AED packet to o.

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for CompressedData[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified CompressedData packet to o.

This function works recursively: if the CompressedData packet contains any packets, they are also serialized.

fn to_vec(&self) -> Result<Vec<u8>>[src]

Serializes the packet to a vector.

impl Serialize for Header[src]

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for Literal[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the Literal data packet to o.

fn to_vec(&self) -> Result<Vec<u8>>[src]

Serializes the packet to a vector.

impl Serialize for MDC[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified MDC packet to o.

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for OnePassSig[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified OnePassSig packet to o.

Errors

Returns Error::InvalidArgument if invoked on a non-version 3 one-pass-signature packet.

fn to_vec(&self) -> Result<Vec<u8>>[src]

Serializes the packet to a vector.

impl Serialize for PKESK[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified PKESK packet to o.

Errors

Returns Error::InvalidArgument if invoked on a non-version 3 PKESK packet.

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for SEIP[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified SEIP packet to o.

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for SKESK4[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified SKESK packet to o.

Errors

Returns Error::InvalidArgument if invoked on a non-version 4 SKESK packet.

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for SKESK5[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified SKESK packet to o.

Errors

Returns Error::InvalidArgument if invoked on a non-version 5 SKESK packet.

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for Unknown[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified Unknown packet to o.

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for UserAttribute[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified UserAttribute packet to o.

fn to_vec(&self) -> Result<Vec<u8>>[src]

Serializes the packet to a vector.

impl Serialize for UserID[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified UserID packet to o.

fn to_vec(&self) -> Result<Vec<u8>>[src]

Serializes the packet to a vector.

impl Serialize for PacketPile[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Writes a serialized version of the specified PacketPile to o.

fn to_vec(&self) -> Result<Vec<u8>>[src]

Serializes the packet to a vector.

impl Serialize for TPK[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Serializes the TPK.

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl Serialize for TSK[src]

fn serialize<W: Write>(&self, o: &mut W) -> Result<()>[src]

Serializes the TSK.

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl<'a> Serialize for SubpacketValue<'a>[src]

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl<'a> Serialize for Subpacket<'a>[src]

fn to_vec(&self) -> Result<Vec<u8>>[src]

Loading content...