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

pub struct Builder { /* fields omitted */ }

Builds a signature packet.

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

Methods

impl Builder[src]

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

Sets the value of the Creation Time subpacket.

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

Sets the value of the Signature Expiration Time subpacket.

If None is given, any expiration subpacket is removed.

pub fn set_exportable_certification(self, exportable: bool) -> Result<Self>[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(self, level: u8, trust: u8) -> Result<Self>[src]

Sets the value of the Trust Signature subpacket.

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

Sets the value of the Regular Expression subpacket.

pub fn set_revocable(self, revocable: bool) -> Result<Self>[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(
    self,
    expiration: Option<Duration>
) -> Result<Self>
[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(
    self,
    preferences: Vec<SymmetricAlgorithm>
) -> Result<Self>
[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(
    self,
    class: u8,
    pk_algo: PublicKeyAlgorithm,
    fp: Fingerprint
) -> Result<Self>
[src]

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

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

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

pub fn set_notation<F>(
    self,
    name: &str,
    value: &[u8],
    flags: F,
    critical: bool
) -> Result<Self> where
    F: Into<Option<NotationDataFlags>>, 
[src]

Sets the value of the Notation Data subpacket with the given name.

Any existing Notation Data subpacket with the given name are replaced.

pub fn add_notation<F>(
    self,
    name: &str,
    value: &[u8],
    flags: F,
    critical: bool
) -> Result<Self> where
    F: Into<Option<NotationDataFlags>>, 
[src]

Adds a Notation Data subpacket with the given name, value, and flags.

Any existing Notation Data subpacket with the given name are kept.

pub fn set_preferred_hash_algorithms(
    self,
    preferences: Vec<HashAlgorithm>
) -> Result<Self>
[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(
    self,
    preferences: Vec<CompressionAlgorithm>
) -> Result<Self>
[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(
    self,
    preferences: KeyServerPreferences
) -> Result<Self>
[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(self, uri: &[u8]) -> Result<Self>[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(self, primary: bool) -> Result<Self>[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(self, uri: &[u8]) -> Result<Self>[src]

Sets the value of the Policy URI subpacket.

pub fn set_key_flags(self, flags: &KeyFlags) -> Result<Self>[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(self, uid: &[u8]) -> Result<Self>[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(
    self,
    code: ReasonForRevocation,
    reason: &[u8]
) -> Result<Self>
[src]

Sets the value of the Reason for Revocation subpacket.

pub fn set_features(self, features: &Features) -> Result<Self>[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(
    self,
    pk_algo: PublicKeyAlgorithm,
    hash_algo: HashAlgorithm,
    digest: &[u8]
) -> Result<Self>
[src]

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

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

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

pub fn set_issuer_fingerprint(self, fp: Fingerprint) -> Result<Self>[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(
    self,
    preferences: Vec<AEADAlgorithm>
) -> Result<Self>
[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(
    self,
    recipients: Vec<Fingerprint>
) -> Result<Self>
[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(self, t: SignatureType) -> Self[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: &mut dyn Signer,
    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: &mut dyn Signer,
    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: &mut dyn Signer,
    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: &mut dyn Signer,
    key: &Key,
    ua: &UserAttribute,
    algo: HashAlgorithm
) -> Result<Signature>
[src]

Signs binding between ua 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_hash(
    self,
    signer: &mut dyn Signer,
    hash_algo: HashAlgorithm,
    hash: Context
) -> 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.

pub fn sign_message(
    self,
    signer: &mut dyn Signer,
    hash_algo: HashAlgorithm,
    msg: &[u8]
) -> Result<Signature>
[src]

Signs message 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 Clone for Builder[src]

impl Eq for Builder[src]

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

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

impl From<Signature> for Builder[src]

impl From<Signature4> for Builder[src]

impl Hash for Builder[src]

fn hash(&self, hash: &mut Context)[src]

Adds the Signature to the provided hash context.

impl Hash for Builder[src]

impl PartialEq<Builder> for Builder[src]

impl StructuralEq for Builder[src]

impl StructuralPartialEq for Builder[src]

Auto Trait Implementations

impl !RefUnwindSafe for Builder

impl Send for Builder

impl !Sync for Builder

impl Unpin for Builder

impl UnwindSafe for Builder

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.