[][src]Enum sequoia_openpgp::packet::signature::subpacket::SubpacketValue

pub enum SubpacketValue<'a> {
    Unknown(&'a [u8]),
    Invalid(&'a [u8]),
    SignatureCreationTime(Tm),
    SignatureExpirationTime(Duration),
    ExportableCertification(bool),
    TrustSignature {
        level: u8,
        trust: u8,
    },
    RegularExpression(&'a [u8]),
    Revocable(bool),
    KeyExpirationTime(Duration),
    PreferredSymmetricAlgorithms(Vec<SymmetricAlgorithm>),
    RevocationKey {
        class: u8,
        pk_algo: PublicKeyAlgorithm,
        fp: Fingerprint,
    },
    Issuer(KeyID),
    NotationData(NotationData<'a>),
    PreferredHashAlgorithms(Vec<HashAlgorithm>),
    PreferredCompressionAlgorithms(Vec<CompressionAlgorithm>),
    KeyServerPreferences(KeyServerPreferences),
    PreferredKeyServer(&'a [u8]),
    PrimaryUserID(bool),
    PolicyURI(&'a [u8]),
    KeyFlags(KeyFlags),
    SignersUserID(&'a [u8]),
    ReasonForRevocation {
        code: ReasonForRevocation,
        reason: &'a [u8],
    },
    Features(Features),
    SignatureTarget {
        pk_algo: PublicKeyAlgorithm,
        hash_algo: HashAlgorithm,
        digest: &'a [u8],
    },
    EmbeddedSignature(Packet),
    IssuerFingerprint(Fingerprint),
    PreferredAEADAlgorithms(Vec<AEADAlgorithm>),
    IntendedRecipient(Fingerprint),
}

Struct holding an arbitrary subpacket.

The value is well structured. See SubpacketTag for a description of these tags.

Variants

Unknown(&'a [u8])

The subpacket is unknown.

Invalid(&'a [u8])

The packet is present, but the value is structured incorrectly.

SignatureCreationTime(Tm)

4-octet time field

SignatureExpirationTime(Duration)

4-octet time field

ExportableCertification(bool)

1 octet of exportability, 0 for not, 1 for exportable

TrustSignature

1 octet "level" (depth), 1 octet of trust amount

Fields of TrustSignature

level: u8

Trust level, or depth.

Level 0 has the same meaning as an ordinary validity signature. Level 1 means that the signed key is asserted to be a valid trusted introducer, with the 2nd octet of the body specifying the degree of trust. Level 2 means that the signed key is asserted to be trusted to issue level 1 trust signatures, i.e., that it is a "meta introducer".

trust: u8

Trust amount.

This is interpreted such that values less than 120 indicate partial trust and values of 120 or greater indicate complete trust. Implementations SHOULD emit values of 60 for partial trust and 120 for complete trust.

RegularExpression(&'a [u8])

Null-terminated regular expression

Revocable(bool)

1 octet of revocability, 0 for not, 1 for revocable

KeyExpirationTime(Duration)

4-octet time field.

PreferredSymmetricAlgorithms(Vec<SymmetricAlgorithm>)

Array of one-octet values

RevocationKey

1 octet of class, 1 octet of public-key algorithm ID, 20 octets of fingerprint

Fields of RevocationKey

class: u8

Class octet must have bit 0x80 set. If the bit 0x40 is set, then this means that the revocation information is sensitive. Other bits are for future expansion to other kinds of authorizations.

pk_algo: PublicKeyAlgorithm

XXX: RFC4880 says nothing about this.

fp: Fingerprint

Fingerprint of authorized key.

Issuer(KeyID)

8-octet Key ID

NotationData(NotationData<'a>)

The notation has a name and a value, each of which are strings of octets..

PreferredHashAlgorithms(Vec<HashAlgorithm>)

Array of one-octet values

PreferredCompressionAlgorithms(Vec<CompressionAlgorithm>)

Array of one-octet values

KeyServerPreferences(KeyServerPreferences)

N octets of flags

PreferredKeyServer(&'a [u8])

String (URL)

PrimaryUserID(bool)

1 octet, Boolean

PolicyURI(&'a [u8])

String (URL)

KeyFlags(KeyFlags)

N octets of flags

SignersUserID(&'a [u8])

String

ReasonForRevocation

1 octet of revocation code, N octets of reason string

Fields of ReasonForRevocation

code: ReasonForRevocation

Machine-readable reason for revocation.

reason: &'a [u8]

Human-readable reason for revocation.

Features(Features)

N octets of flags

SignatureTarget

1-octet public-key algorithm, 1 octet hash algorithm, N octets hash

Fields of SignatureTarget

pk_algo: PublicKeyAlgorithm

Public-key algorithm of the target signature.

hash_algo: HashAlgorithm

Hash algorithm of the target signature.

digest: &'a [u8]

Hash digest of the target signature.

EmbeddedSignature(Packet)

An embedded signature.

This is a packet rather than a Signature, because we also want to return an Unknown packet.

IssuerFingerprint(Fingerprint)

20-octet V4 fingerprint.

PreferredAEADAlgorithms(Vec<AEADAlgorithm>)

Preferred AEAD Algorithms.

IntendedRecipient(Fingerprint)

Intended Recipient Fingerprint [proposed].

Methods

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

pub fn len(&self) -> u32[src]

Returns the length of the serialized value.

pub fn tag(&self) -> Result<SubpacketTag>[src]

Returns the subpacket tag for this value.

Trait Implementations

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

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

Exports a serialized version of the object to o. Read more

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

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

Serializes the packet to a vector.

fn export_into(&self, buf: &mut [u8]) -> Result<usize>[src]

Exports into the given buffer. Read more

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

Exports to a vector. Read more

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

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

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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

Auto Trait Implementations

impl<'a> Send for SubpacketValue<'a>

impl<'a> Sync for SubpacketValue<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip for T where
    V: MultiLane<T>,