[][src]Struct sequoia_openpgp::packet::signature::Builder

pub struct Builder { /* fields omitted */ }

Builds a signature packet.

This is the mutable version of a Signature packet. To convert it to one, use sign_hash(..).

Methods

impl Builder[src]

pub fn hash<H: Hash>(&self, hash: &mut H)[src]

Adds the Signature to the provided hash context.

impl Builder[src]

pub fn set_signature_creation_time(&mut self, creation_time: Tm) -> Result<()>[src]

Sets the value of the Creation Time subpacket.

pub fn set_signature_expiration_time(
    &mut self,
    expiration: Option<Duration>
) -> Result<()>
[src]

Sets the value of the Signature Expiration Time subpacket.

If None is given, any expiration subpacket is removed.

pub fn set_exportable_certification(&mut self, exportable: bool) -> Result<()>[src]

Sets 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).

pub fn set_trust_signature(&mut self, level: u8, trust: u8) -> Result<()>[src]

Sets the value of the Trust Signature subpacket.

pub fn set_regular_expression(&mut self, re: &[u8]) -> Result<()>[src]

Sets the value of the Regular Expression subpacket.

pub fn set_revocable(&mut self, revocable: bool) -> Result<()>[src]

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

pub fn set_key_expiration_time(
    &mut self,
    expiration: Option<Duration>
) -> Result<()>
[src]

Sets 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 None is given, any expiration subpacket is removed.

pub fn set_preferred_symmetric_algorithms(
    &mut self,
    preferences: Vec<SymmetricAlgorithm>
) -> Result<()>
[src]

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

pub fn set_revocation_key(
    &mut self,
    class: u8,
    pk_algo: PublicKeyAlgorithm,
    fp: Fingerprint
) -> Result<()>
[src]

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

pub fn set_issuer(&mut self, id: KeyID) -> Result<()>[src]

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

pub fn set_preferred_hash_algorithms(
    &mut self,
    preferences: Vec<HashAlgorithm>
) -> Result<()>
[src]

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

pub fn set_preferred_compression_algorithms(
    &mut self,
    preferences: Vec<CompressionAlgorithm>
) -> Result<()>
[src]

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

pub fn set_key_server_preferences(
    &mut self,
    preferences: KeyServerPreferences
) -> Result<()>
[src]

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

pub fn set_preferred_key_server(&mut self, uri: &[u8]) -> Result<()>[src]

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

pub fn set_primary_userid(&mut self, primary: bool) -> Result<()>[src]

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

pub fn set_policy_uri(&mut self, uri: &[u8]) -> Result<()>[src]

Sets the value of the Policy URI subpacket.

pub fn set_key_flags(&mut self, flags: &KeyFlags) -> Result<()>[src]

Sets 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).

pub fn set_signers_user_id(&mut self, uid: &[u8]) -> Result<()>[src]

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

pub fn set_reason_for_revocation(
    &mut self,
    code: ReasonForRevocation,
    reason: &[u8]
) -> Result<()>
[src]

Sets the value of the Reason for Revocation subpacket.

pub fn set_features(&mut self, features: &Features) -> Result<()>[src]

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

pub fn set_signature_target(
    &mut self,
    pk_algo: PublicKeyAlgorithm,
    hash_algo: HashAlgorithm,
    digest: &[u8]
) -> Result<()>
[src]

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

pub fn set_embedded_signature(&mut self, signature: Signature) -> Result<()>[src]

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

pub fn set_issuer_fingerprint(&mut self, fp: Fingerprint) -> Result<()>[src]

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

pub fn set_preferred_aead_algorithms(
    &mut self,
    preferences: Vec<AEADAlgorithm>
) -> Result<()>
[src]

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

pub fn set_intended_recipients(
    &mut self,
    recipients: Vec<Fingerprint>
) -> Result<()>
[src]

Sets the intended recipients.

impl Builder[src]

pub fn new(sigtype: SignatureType) -> Self[src]

Returns a new Builder object.

pub fn version(&self) -> u8[src]

Gets the version.

pub fn sigtype(&self) -> SignatureType[src]

Gets the signature type.

pub fn set_sigtype(&mut self, t: SignatureType)[src]

Sets the signature type.

pub fn pk_algo(&self) -> PublicKeyAlgorithm[src]

Gets the public key algorithm.

pub fn hash_algo(&self) -> HashAlgorithm[src]

Gets the hash algorithm.

pub fn hashed_area(&self) -> &SubpacketArea[src]

Gets a reference to the hashed area.

pub fn hashed_area_mut(&mut self) -> &mut SubpacketArea[src]

Gets a mutable reference to the hashed area.

pub fn unhashed_area(&self) -> &SubpacketArea[src]

Gets a reference to the unhashed area.

pub fn unhashed_area_mut(&mut self) -> &mut SubpacketArea[src]

Gets a mutable reference to the unhashed area.

pub fn sign_primary_key_binding(
    self,
    signer: &Key,
    signer_sec: &SecretKey,
    algo: HashAlgorithm
) -> Result<Signature>
[src]

Signs signer using itself.

The Signature's public-key algorithm field is set to the algorithm used by signer, the hash-algorithm field is set to hash_algo.

pub fn sign_userid_binding(
    self,
    signer: &Key,
    signer_sec: &SecretKey,
    key: &Key,
    userid: &UserID,
    algo: HashAlgorithm
) -> Result<Signature>
[src]

Signs binding between userid and key using signer.

The Signature's public-key algorithm field is set to the algorithm used by signer, the hash-algorithm field is set to hash_algo.

pub fn sign_subkey_binding(
    self,
    signer: &Key,
    signer_sec: &SecretKey,
    primary: &Key,
    subkey: &Key,
    algo: HashAlgorithm
) -> Result<Signature>
[src]

Signs subkey binding from primary to subkey using signer.

The Signature's public-key algorithm field is set to the algorithm used by signer, the hash-algorithm field is set to hash_algo.

pub fn sign_user_attribute_binding(
    self,
    signer: &Key,
    signer_sec: &SecretKey,
    ua: &UserAttribute,
    algo: HashAlgorithm
) -> Result<Signature>
[src]

Signs ua using signer.

The Signature's public-key algorithm field is set to the algorithm used by signer, the hash-algorithm field is set to hash_algo.

pub fn sign_hash(
    self,
    signer: &Key,
    signer_sec: &SecretKey,
    hash_algo: HashAlgorithm,
    hash: Box<dyn Hash>
) -> Result<Signature>
[src]

Signs hash using signer.

The Signature's public-key algorithm field is set to the algorithm used by signer, the hash-algorithm field is set to hash_algo.

Trait Implementations

impl From<Signature> for Builder[src]

impl<'a> From<&'a Signature> for &'a Builder[src]

impl Eq for Builder[src]

impl PartialEq<Builder> for Builder[src]

impl Clone for Builder[src]

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

Performs copy-assignment from source. Read more

impl Hash for Builder[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

Auto Trait Implementations

impl Send for Builder

impl !Sync for Builder

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.