[][src]Struct sequoia_openpgp::packet::signature::subpacket::SubpacketArea

pub struct SubpacketArea { /* fields omitted */ }

Subpacket area.

Implementations

impl SubpacketArea[src]

pub fn new(packets: Vec<Subpacket>) -> SubpacketArea[src]

Returns a new subpacket area based on data.

pub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a Subpacket>[src]

Iterates over the subpackets.

pub fn lookup(&self, tag: SubpacketTag) -> Option<&Subpacket>[src]

Returns the last subpacket, if any, with the specified tag.

This is the recommended strategy of dealing with multiple, possibly conflicting, subpackets. See Section 5.2.4.1 of RFC 4880.

pub fn add(&mut self, packet: Subpacket) -> Result<()>[src]

Adds the given subpacket.

Errors

Returns Error::MalformedPacket if adding the packet makes the subpacket area exceed the size limit.

pub fn replace(&mut self, packet: Subpacket) -> Result<()>[src]

Adds the given subpacket, replacing all other subpackets with the same tag.

Errors

Returns Error::MalformedPacket if adding the packet makes the subpacket area exceed the size limit.

pub fn remove_all(&mut self, tag: SubpacketTag)[src]

Removes all subpackets with the given tag.

Returns the old subpacket area, so that it can be restored if necessary.

pub fn clear(&mut self)[src]

Removes all subpackets.

pub fn sort(&mut self)[src]

Sorts the subpackets by subpacket tag.

This normalizes the subpacket area, and accelerates lookups in implementations that sort the in-core representation and use binary search for lookups.

impl SubpacketArea[src]

pub fn signature_creation_time(&self) -> Option<SystemTime>[src]

Returns the value of the Creation Time subpacket, which contains the time when the signature was created as a unix timestamp.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn signature_validity_period(&self) -> Option<Duration>[src]

Returns the value of the Signature Expiration Time subpacket, which contains when the signature expires as the number of seconds after its creation.

If the subpacket is not present, this returns None. If this function returns None, or the returned period is 0, the signature does not expire.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn exportable_certification(&self) -> Option<bool>[src]

Returns the value of the Exportable Certification subpacket, which contains whether the certification should be exported (i.e., whether the packet is not a local signature).

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn trust_signature(&self) -> Option<(u8, u8)>[src]

Returns the value of the Trust Signature subpacket.

The return value is a tuple consisting of the level or depth and the trust amount.

Recall from Section 5.2.3.13 of RFC 4880:

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".

And, the trust amount 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.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn regular_expression(&self) -> Option<&[u8]>[src]

Returns the value of the Regular Expression subpacket.

Note: the serialized form includes a trailing NUL byte. This returns the value without the trailing NUL.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn revocable(&self) -> Option<bool>[src]

Returns the value of the Revocable subpacket, which indicates whether the signature is revocable, i.e., whether revocation certificates for this signature should be ignored.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn key_validity_period(&self) -> Option<Duration>[src]

Returns the value of the Key Expiration Time subpacket, which contains when the referenced key expires as the number of seconds after the key's creation.

If the subpacket is not present, this returns None. If this function returns None, or the returned period is 0, the key does not expire.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn preferred_symmetric_algorithms(&self) -> Option<&[SymmetricAlgorithm]>[src]

Returns the value of the Preferred Symmetric Algorithms subpacket, which contains the list of symmetric algorithms that the key holder prefers, ordered according by the key holder's preference.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn revocation_keys(&self) -> impl Iterator<Item = &RevocationKey>[src]

Returns the value of the Revocation Key subpacket, which contains a designated revoker.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn issuer(&self) -> Option<&KeyID>[src]

Returns the value of the Issuer subpacket, which contains the KeyID of the key that allegedly created this signature.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn notation_data(&self) -> Vec<&NotationData>[src]

Returns the value of all Notation Data packets.

If the subpacket is not present or malformed, this returns an empty vector.

Note: unlike other subpacket accessor functions, this function returns all the Notation Data subpackets, not just the last one.

pub fn notation<N>(&self, name: N) -> Vec<&[u8]> where
    N: AsRef<str>, 
[src]

Returns the value of all Notation Data subpackets with the given name.

pub fn preferred_hash_algorithms(&self) -> Option<&[HashAlgorithm]>[src]

Returns the value of the Preferred Hash Algorithms subpacket, which contains the list of hash algorithms that the key holders prefers, ordered according by the key holder's preference.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn preferred_compression_algorithms(
    &self
) -> Option<&[CompressionAlgorithm]>
[src]

Returns the value of the Preferred Compression Algorithms subpacket, which contains the list of compression algorithms that the key holder prefers, ordered according by the key holder's preference.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn key_server_preferences(&self) -> Option<KeyServerPreferences>[src]

Returns the value of the Key Server Preferences subpacket, which contains the key holder's key server preferences.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn preferred_key_server(&self) -> Option<&[u8]>[src]

Returns the value of the Preferred Key Server subpacket, which contains the user's preferred key server for updates.

Note: this packet should be ignored, because it acts as key tracker.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn primary_userid(&self) -> Option<bool>[src]

Returns the value of the Primary UserID subpacket, which indicates whether the referenced UserID should be considered the user's primary User ID.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn policy_uri(&self) -> Option<&[u8]>[src]

Returns the value of the Policy URI subpacket.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn key_flags(&self) -> Option<KeyFlags>[src]

Returns the value of the Key Flags subpacket, which contains information about the referenced key, in particular, how it is used (certification, signing, encryption, authentication), and how it is stored (split, held by multiple people).

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn signers_user_id(&self) -> Option<&[u8]>[src]

Returns the value of the Signer's UserID subpacket, which contains the User ID that the key holder considers responsible for the signature.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn reason_for_revocation(&self) -> Option<(ReasonForRevocation, &[u8])>[src]

Returns the value of the Reason for Revocation subpacket.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn features(&self) -> Option<Features>[src]

Returns the value of the Features subpacket, which contains a list of features that the user's OpenPGP implementation supports.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn signature_target(
    &self
) -> Option<(PublicKeyAlgorithm, HashAlgorithm, &[u8])>
[src]

Returns the value of the Signature Target subpacket, which contains the hash of the referenced signature packet.

This is used, for instance, by a signature revocation certification to designate the signature that is being revoked.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn embedded_signature(&self) -> Option<&Signature>[src]

Returns the value of the Embedded Signature subpacket, which contains a signature.

This is used, for instance, to store a subkey's primary key binding signature (0x19).

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn issuer_fingerprint(&self) -> Option<&Fingerprint>[src]

Returns the value of the Issuer Fingerprint subpacket, which contains the fingerprint of the key that allegedly created this signature.

This subpacket should be preferred to the Issuer subpacket, because Fingerprints are not subject to collisions.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn preferred_aead_algorithms(&self) -> Option<&[AEADAlgorithm]>[src]

Returns the value of the Preferred AEAD Algorithms subpacket, which contains the list of AEAD algorithms that the key holder prefers, ordered according by the key holder's preference.

If the subpacket is not present, this returns None.

Note: if the signature contains multiple instances of this subpacket, only the last one is considered.

pub fn intended_recipients(&self) -> Vec<Fingerprint>[src]

Returns the intended recipients.

Trait Implementations

impl Arbitrary for SubpacketArea[src]

impl Clone for SubpacketArea[src]

impl Debug for SubpacketArea[src]

impl Default for SubpacketArea[src]

impl Eq for SubpacketArea[src]

impl Hash for SubpacketArea[src]

impl<'a> IntoIterator for &'a SubpacketArea[src]

type Item = &'a Subpacket

The type of the elements being iterated over.

type IntoIter = Iter<'a, Subpacket>

Which kind of iterator are we turning this into?

impl Marshal for SubpacketArea[src]

impl MarshalInto for SubpacketArea[src]

impl PartialEq<SubpacketArea> for SubpacketArea[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V> for T where
    V: MultiLane<T>,