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

pub enum SubpacketValue {
    Unknown {
        tag: SubpacketTag,
        body: Vec<u8>,
    },
    SignatureCreationTime(Timestamp),
    SignatureExpirationTime(Duration),
    ExportableCertification(bool),
    TrustSignature {
        level: u8,
        trust: u8,
    },
    RegularExpression(Vec<u8>),
    Revocable(bool),
    KeyExpirationTime(Duration),
    PreferredSymmetricAlgorithms(Vec<SymmetricAlgorithm>),
    RevocationKey(RevocationKey),
    Issuer(KeyID),
    NotationData(NotationData),
    PreferredHashAlgorithms(Vec<HashAlgorithm>),
    PreferredCompressionAlgorithms(Vec<CompressionAlgorithm>),
    KeyServerPreferences(KeyServerPreferences),
    PreferredKeyServer(Vec<u8>),
    PrimaryUserID(bool),
    PolicyURI(Vec<u8>),
    KeyFlags(KeyFlags),
    SignersUserID(Vec<u8>),
    ReasonForRevocation {
        code: ReasonForRevocation,
        reason: Vec<u8>,
    },
    Features(Features),
    SignatureTarget {
        pk_algo: PublicKeyAlgorithm,
        hash_algo: HashAlgorithm,
        digest: Vec<u8>,
    },
    EmbeddedSignature(Signature),
    IssuerFingerprint(Fingerprint),
    PreferredAEADAlgorithms(Vec<AEADAlgorithm>),
    IntendedRecipient(Fingerprint),
    // some variants omitted
}

Struct holding an arbitrary subpacket.

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

Note: This enum cannot be exhaustively matched to allow future extensions.

Variants

Unknown

An unknown subpacket.

Fields of Unknown

tag: SubpacketTag

The unknown subpacket's tag.

body: Vec<u8>

The unknown subpacket's uninterpreted body.

SignatureCreationTime(Timestamp)

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(Vec<u8>)

A regular expression.

Note: The RFC requires that the serialized form includes a trailing NUL byte. When Sequoia parses the regular expression subpacket, it strips the trailing NUL. (If it doesn't include a NUL, then parsing fails.) Likewise, when it serializes a regular expression subpacket, it unconditionally adds a NUL.

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(RevocationKey)

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

Issuer(KeyID)

8-octet Key ID

NotationData(NotationData)

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(Vec<u8>)

String (URL)

PrimaryUserID(bool)

1 octet, Boolean

PolicyURI(Vec<u8>)

String (URL)

KeyFlags(KeyFlags)

N octets of flags

SignersUserID(Vec<u8>)

String

ReasonForRevocation

1 octet of revocation code, N octets of reason string

Fields of ReasonForRevocation

code: ReasonForRevocation

Machine-readable reason for revocation.

reason: Vec<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: Vec<u8>

Hash digest of the target signature.

EmbeddedSignature(Signature)

An embedded signature.

IssuerFingerprint(Fingerprint)

20-octet V4 fingerprint.

PreferredAEADAlgorithms(Vec<AEADAlgorithm>)

Preferred AEAD Algorithms.

IntendedRecipient(Fingerprint)

Intended Recipient Fingerprint (proposed).

Methods

impl SubpacketValue[src]

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

Returns the subpacket tag for this value.

Trait Implementations

impl Marshal for SubpacketValue[src]

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

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

impl MarshalInto for SubpacketValue[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 Eq for SubpacketValue[src]

impl PartialEq<SubpacketValue> for SubpacketValue[src]

impl Clone for SubpacketValue[src]

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

Performs copy-assignment from source. Read more

impl Hash for SubpacketValue[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for SubpacketValue[src]

Auto Trait Implementations

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<T> DynClone for T where
    T: Clone
[src]