Struct pgp::packet::config::SignatureConfig [−][src]
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
pub fn new_v4(
version: SignatureVersion,
typ: SignatureType,
pub_alg: PublicKeyAlgorithm,
hash_alg: HashAlgorithm,
hashed_subpackets: Vec<Subpacket>,
unhashed_subpackets: Vec<Subpacket>
) -> Self
Sign the given data.
pub 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.
pub 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.
pub 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.
Returns what kind of signature this is.
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,
Returns an iterator over all subpackets of this signature.
Returns if the signature is a certificate or not.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self