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
sourceimpl 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
sourceimpl Clone for SignatureConfig
impl Clone for SignatureConfig
sourcefn clone(&self) -> SignatureConfig
fn clone(&self) -> SignatureConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SignatureConfig
impl Debug for SignatureConfig
sourceimpl PartialEq<SignatureConfig> for SignatureConfig
impl PartialEq<SignatureConfig> for SignatureConfig
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &SignatureConfig) -> bool
fn ne(&self, other: &SignatureConfig) -> bool
This method tests for !=
.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more