pub struct SignatureConfig {
pub version: SignatureVersion,
pub typ: SignatureType,
pub pub_alg: PublicKeyAlgorithm,
pub hash_alg: HashAlgorithm,
pub unhashed_subpackets: Vec<Subpacket, Global>,
pub hashed_subpackets: Vec<Subpacket, Global>,
pub created: Option<DateTime<Utc>>,
pub issuer: Option<KeyId>,
}
Fields§
§version: SignatureVersion
§typ: SignatureType
§pub_alg: PublicKeyAlgorithm
§hash_alg: HashAlgorithm
§unhashed_subpackets: Vec<Subpacket, Global>
§hashed_subpackets: Vec<Subpacket, Global>
§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, Global>, unhashed_subpackets: Vec<Subpacket, Global> ) -> SignatureConfig
sourcepub fn sign<F, R>(
self,
key: &impl SecretKeyTrait,
key_pw: F,
data: R
) -> Result<Signature, Error>where
F: FnOnce() -> String,
R: Read,
pub fn sign<F, R>( self, key: &impl SecretKeyTrait, key_pw: F, data: R ) -> Result<Signature, Error>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, Error>where
F: FnOnce() -> String,
pub fn sign_certificate<F>( self, key: &impl SecretKeyTrait, key_pw: F, tag: Tag, id: &impl Serialize ) -> Result<Signature, Error>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, Error>where
F: FnOnce() -> String,
pub fn sign_key_binding<F>( self, signing_key: &impl SecretKeyTrait, key_pw: F, key: &impl PublicKeyTrait ) -> Result<Signature, Error>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, Error>where
F: FnOnce() -> String,
pub fn sign_key<F>( self, signing_key: &impl SecretKeyTrait, key_pw: F, key: &impl PublicKeyTrait ) -> Result<Signature, Error>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, Error>
pub fn hash_signature_data( &self, hasher: &mut dyn Hasher ) -> Result<usize, Error>
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, Error>where R: Read,
pub fn trailer(&self, len: usize) -> Vec<u8, Global> ⓘ
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 ==
.impl Eq for SignatureConfig
impl StructuralEq for SignatureConfig
impl StructuralPartialEq for SignatureConfig
Auto Trait Implementations§
impl RefUnwindSafe for SignatureConfig
impl Send for SignatureConfig
impl Sync for SignatureConfig
impl Unpin for SignatureConfig
impl UnwindSafe for SignatureConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.