Struct pgp::packet::SignatureConfig
source · pub struct SignatureConfig {
pub version: SignatureVersion,
pub typ: SignatureType,
pub pub_alg: PublicKeyAlgorithm,
pub hash_alg: HashAlgorithm,
pub unhashed_subpackets: Vec<Subpacket>,
pub hashed_subpackets: Vec<Subpacket>,
pub created: Option<DateTime<Utc>>,
pub issuer: Option<KeyId>,
}
Fields§
§version: SignatureVersion
§typ: SignatureType
§pub_alg: PublicKeyAlgorithm
§hash_alg: HashAlgorithm
§unhashed_subpackets: Vec<Subpacket>
§hashed_subpackets: Vec<Subpacket>
§created: Option<DateTime<Utc>>
§issuer: Option<KeyId>
Implementations§
source§impl SignatureConfig
impl SignatureConfig
pub fn new_v4( version: SignatureVersion, typ: SignatureType, pub_alg: PublicKeyAlgorithm, hash_alg: HashAlgorithm, hashed_subpackets: Vec<Subpacket>, unhashed_subpackets: Vec<Subpacket> ) -> Self
sourcepub fn sign<F, R>(
self,
key: &impl SecretKeyTrait,
key_pw: F,
data: R
) -> Result<Signature>where
F: FnOnce() -> String,
R: Read,
pub fn sign<F, R>( self, key: &impl SecretKeyTrait, key_pw: F, data: R ) -> Result<Signature>where F: FnOnce() -> String, R: Read,
Sign the given data.
sourcepub fn sign_certificate<F>(
self,
key: &impl SecretKeyTrait,
key_pw: F,
tag: Tag,
id: &impl Serialize
) -> Result<Signature>where
F: FnOnce() -> String,
pub fn sign_certificate<F>( self, key: &impl SecretKeyTrait, key_pw: F, tag: Tag, id: &impl Serialize ) -> Result<Signature>where F: FnOnce() -> String,
Create a certificate siganture.
sourcepub fn sign_key_binding<F>(
self,
signing_key: &impl SecretKeyTrait,
key_pw: F,
key: &impl PublicKeyTrait
) -> Result<Signature>where
F: FnOnce() -> String,
pub fn sign_key_binding<F>( self, signing_key: &impl SecretKeyTrait, key_pw: F, key: &impl PublicKeyTrait ) -> Result<Signature>where F: FnOnce() -> String,
Sign a key binding.
sourcepub fn sign_key<F>(
self,
signing_key: &impl SecretKeyTrait,
key_pw: F,
key: &impl PublicKeyTrait
) -> Result<Signature>where
F: FnOnce() -> String,
pub fn sign_key<F>( self, signing_key: &impl SecretKeyTrait, key_pw: F, key: &impl PublicKeyTrait ) -> Result<Signature>where F: FnOnce() -> String,
Signs a direct key signature or a revocation.
sourcepub fn typ(&self) -> SignatureType
pub fn typ(&self) -> SignatureType
Returns what kind of signature this is.
sourcepub fn hash_signature_data(&self, hasher: &mut dyn Hasher) -> Result<usize>
pub fn hash_signature_data(&self, hasher: &mut dyn Hasher) -> Result<usize>
Calcluate the serialized version of this packet, but only the part relevant for hashing.
pub fn hash_data_to_sign<R>( &self, hasher: &mut dyn Hasher, data: R ) -> Result<usize>where R: Read,
pub fn trailer(&self, len: usize) -> Vec<u8> ⓘ
sourcepub fn subpackets(&self) -> impl Iterator<Item = &Subpacket>
pub fn subpackets(&self) -> impl Iterator<Item = &Subpacket>
Returns an iterator over all subpackets of this signature.
sourcepub fn is_certificate(&self) -> bool
pub fn is_certificate(&self) -> bool
Returns if the signature is a certificate or not.
pub fn created(&self) -> Option<&DateTime<Utc>>
pub fn issuer(&self) -> Option<&KeyId>
Trait Implementations§
source§impl Clone for SignatureConfig
impl Clone for SignatureConfig
source§fn clone(&self) -> SignatureConfig
fn clone(&self) -> SignatureConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SignatureConfig
impl Debug for SignatureConfig
source§impl PartialEq<SignatureConfig> for SignatureConfig
impl PartialEq<SignatureConfig> for SignatureConfig
source§fn eq(&self, other: &SignatureConfig) -> bool
fn eq(&self, other: &SignatureConfig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.