pub struct Signature {
pub config: SignatureConfig,
pub signed_hash_value: [u8; 2],
pub signature: Vec<Mpi, Global>,
/* private fields */
}
Expand description
Signature Packet https://tools.ietf.org/html/rfc4880.html#section-5.2
Fields§
§config: SignatureConfig
§signed_hash_value: [u8; 2]
§signature: Vec<Mpi, Global>
Implementations§
source§impl Signature
impl Signature
pub fn new( packet_version: Version, version: SignatureVersion, typ: SignatureType, pub_alg: PublicKeyAlgorithm, hash_alg: HashAlgorithm, signed_hash_value: [u8; 2], signature: Vec<Mpi, Global>, hashed_subpackets: Vec<Subpacket, Global>, unhashed_subpackets: Vec<Subpacket, Global> ) -> Signature
pub fn from_config( config: SignatureConfig, signed_hash_value: [u8; 2], signature: Vec<Mpi, Global> ) -> Signature
sourcepub fn typ(&self) -> SignatureType
pub fn typ(&self) -> SignatureType
Returns what kind of signature this is.
sourcepub fn verify<R>(&self, key: &impl PublicKeyTrait, data: R) -> Result<(), Error>where
R: Read,
pub fn verify<R>(&self, key: &impl PublicKeyTrait, data: R) -> Result<(), Error>where R: Read,
Verify this signature.
sourcepub fn verify_certificate(
&self,
key: &impl PublicKeyTrait,
tag: Tag,
id: &impl Serialize
) -> Result<(), Error>
pub fn verify_certificate( &self, key: &impl PublicKeyTrait, tag: Tag, id: &impl Serialize ) -> Result<(), Error>
Verifies a certificate siganture type.
sourcepub fn verify_key_binding(
&self,
signing_key: &impl PublicKeyTrait,
key: &impl PublicKeyTrait
) -> Result<(), Error>
pub fn verify_key_binding( &self, signing_key: &impl PublicKeyTrait, key: &impl PublicKeyTrait ) -> Result<(), Error>
Verifies a key binding.
sourcepub fn verify_key(&self, key: &impl PublicKeyTrait) -> Result<(), Error>
pub fn verify_key(&self, key: &impl PublicKeyTrait) -> Result<(), Error>
Verifies a direct key signature or a revocation.
sourcepub fn is_certificate(&self) -> bool
pub fn is_certificate(&self) -> bool
Returns if the signature is a certificate or not.
pub fn key_expiration_time(&self) -> Option<&DateTime<Utc>>
pub fn signature_expiration_time(&self) -> Option<&DateTime<Utc>>
pub fn created(&self) -> Option<&DateTime<Utc>>
pub fn issuer(&self) -> Option<&KeyId>
pub fn preferred_symmetric_algs(&self) -> &[SymmetricKeyAlgorithm]
pub fn preferred_hash_algs(&self) -> &[HashAlgorithm]
pub fn preferred_compression_algs(&self) -> &[CompressionAlgorithm]
pub fn key_server_prefs(&self) -> &[u8] ⓘ
pub fn key_flags(&self) -> KeyFlags
pub fn features(&self) -> &[u8] ⓘ
pub fn revocation_reason_code(&self) -> Option<&RevocationCode>
pub fn revocation_reason_string(&self) -> Option<&BStr>
pub fn is_primary(&self) -> bool
pub fn is_revocable(&self) -> bool
pub fn embedded_signature(&self) -> Option<&Signature>
pub fn preferred_key_server(&self) -> Option<&str>
pub fn notations(&self) -> Vec<&Notation, Global>
pub fn revocation_key(&self) -> Option<&RevocationKey>
sourcepub fn signers_userid(&self) -> Option<&BStr>
pub fn signers_userid(&self) -> Option<&BStr>
Gets the user id of the signer
Note that the user id may not be valid utf-8, if it was created using a different encoding. But since the RFC describes every text as utf-8 it is up to the caller whether to error on non utf-8 data.
pub fn policy_uri(&self) -> Option<&str>
pub fn trust_signature(&self) -> Option<(u8, u8)>
pub fn regular_expression(&self) -> Option<&BStr>
pub fn exportable_certification(&self) -> bool
Trait Implementations§
source§impl Deserialize for Signature
impl Deserialize for Signature
source§impl PacketTrait for Signature
impl PacketTrait for Signature
source§impl PartialEq<Signature> for Signature
impl PartialEq<Signature> for Signature
impl Eq for Signature
impl StructuralEq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
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.