[−][src]Struct sequoia_openpgp::packet::signature::Signature4
Holds a v4 Signature packet.
This holds a version 4 Signature packet. Normally, you won't
directly work with this data structure, but with the Signature
enum, which is version agnostic. An exception is when you need to
do version-specific operations. But currently, there aren't any
version-specific methods.
Implementations
impl Signature4
[src]
pub fn new(
typ: SignatureType,
pk_algo: PublicKeyAlgorithm,
hash_algo: HashAlgorithm,
hashed_area: SubpacketArea,
unhashed_area: SubpacketArea,
digest_prefix: [u8; 2],
mpis: Signature
) -> Self
[src]
typ: SignatureType,
pk_algo: PublicKeyAlgorithm,
hash_algo: HashAlgorithm,
hashed_area: SubpacketArea,
unhashed_area: SubpacketArea,
digest_prefix: [u8; 2],
mpis: Signature
) -> Self
Creates a new signature packet.
If you want to sign something, consider using the SignatureBuilder
interface.
pub fn pk_algo(&self) -> PublicKeyAlgorithm
[src]
Gets the public key algorithm.
pub fn digest_prefix(&self) -> &[u8; 2]
[src]
Gets the hash prefix.
pub fn mpis(&self) -> &Signature
[src]
Gets the signature packet's MPIs.
pub fn computed_digest(&self) -> Option<&[u8]>
[src]
Gets the computed hash value.
This is set by the PacketParser
when parsing the message.
pub fn level(&self) -> usize
[src]
Gets the signature level.
A level of 0 indicates that the signature is directly over the data, a level of 1 means that the signature is a notarization over all level 0 signatures and the data, and so on.
pub fn exportable(&self) -> Result<()>
[src]
Returns whether or not this signature should be exported.
This checks whether the Exportable Certification
subpacket
is absent or present and 1, and that the signature does not
include any sensitive Revocation Key
(designated revokers)
subpackets.
Methods from Deref<Target = SignatureFields>
pub fn hash_standalone(&self, hash: &mut dyn Digest)
[src]
Computes the message digest of standalone signatures.
pub fn hash_timestamp(&self, hash: &mut dyn Digest)
[src]
Computes the message digest of timestamp signatures.
pub fn hash_direct_key<P>(
&self,
hash: &mut dyn Digest,
key: &Key<P, PrimaryRole>
) where
P: KeyParts,
[src]
&self,
hash: &mut dyn Digest,
key: &Key<P, PrimaryRole>
) where
P: KeyParts,
Returns the message digest of the direct key signature over the specified primary key.
pub fn hash_subkey_binding<P, Q>(
&self,
hash: &mut dyn Digest,
key: &Key<P, PrimaryRole>,
subkey: &Key<Q, SubordinateRole>
) where
P: KeyParts,
Q: KeyParts,
[src]
&self,
hash: &mut dyn Digest,
key: &Key<P, PrimaryRole>,
subkey: &Key<Q, SubordinateRole>
) where
P: KeyParts,
Q: KeyParts,
Returns the message digest of the subkey binding over the specified primary key and subkey.
pub fn hash_primary_key_binding<P, Q>(
&self,
hash: &mut dyn Digest,
key: &Key<P, PrimaryRole>,
subkey: &Key<Q, SubordinateRole>
) where
P: KeyParts,
Q: KeyParts,
[src]
&self,
hash: &mut dyn Digest,
key: &Key<P, PrimaryRole>,
subkey: &Key<Q, SubordinateRole>
) where
P: KeyParts,
Q: KeyParts,
Returns the message digest of the primary key binding over the specified primary key and subkey.
pub fn hash_userid_binding<P>(
&self,
hash: &mut dyn Digest,
key: &Key<P, PrimaryRole>,
userid: &UserID
) where
P: KeyParts,
[src]
&self,
hash: &mut dyn Digest,
key: &Key<P, PrimaryRole>,
userid: &UserID
) where
P: KeyParts,
Returns the message digest of the user ID binding over the specified primary key, user ID, and signature.
pub fn hash_user_attribute_binding<P>(
&self,
hash: &mut dyn Digest,
key: &Key<P, PrimaryRole>,
ua: &UserAttribute
) where
P: KeyParts,
[src]
&self,
hash: &mut dyn Digest,
key: &Key<P, PrimaryRole>,
ua: &UserAttribute
) where
P: KeyParts,
Returns the message digest of the user attribute binding over the specified primary key, user attribute, and signature.
pub fn version(&self) -> u8
[src]
Gets the version.
pub fn typ(&self) -> SignatureType
[src]
Gets the signature type.
This function is called typ
and not type
, because type
is a reserved word.
pub fn hash_algo(&self) -> HashAlgorithm
[src]
Gets the hash algorithm.
Trait Implementations
impl Clone for Signature4
[src]
pub fn clone(&self) -> Signature4
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Signature4
[src]
impl Deref for Signature4
[src]
type Target = SignatureFields
The resulting type after dereferencing.
pub fn deref(&self) -> &Self::Target
[src]
impl DerefMut for Signature4
[src]
impl Eq for Signature4
[src]
impl From<Signature4> for SignatureBuilder
[src]
pub fn from(sig: Signature4) -> Self
[src]
impl From<Signature4> for Packet
[src]
pub fn from(s: Signature4) -> Self
[src]
impl From<Signature4> for Signature
[src]
pub fn from(s: Signature4) -> Self
[src]
impl Hash for Signature4
[src]
impl Hash for Signature4
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Marshal for Signature4
[src]
pub fn serialize(&self, o: &mut dyn Write) -> Result<()>
[src]
Writes a serialized version of the specified Signature
packet to o
.
Errors
Returns Error::InvalidArgument
if either the hashed-area
or the unhashed-area exceeds the size limit of 2^16.
pub fn export(&self, o: &mut dyn Write) -> Result<()>
[src]
impl MarshalInto for Signature4
[src]
pub fn serialized_len(&self) -> usize
[src]
pub fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
pub fn export_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
pub fn export_to_vec(&self) -> Result<Vec<u8>>
[src]
pub fn to_vec(&self) -> Result<Vec<u8>>
[src]
impl Ord for Signature4
[src]
pub fn cmp(&self, other: &Signature4) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Signature4> for Signature4
[src]
pub fn eq(&self, other: &Signature4) -> bool
[src]
This method tests for self and other values to be equal, and is used by ==.
This method compares the serialized version of the two
packets. Thus, the computed values are ignored (level
,
computed_digest
).
Note: because this function also compares the unhashed
subpacket area, it is possible for a malicious party to take
valid signatures, add subpackets to the unhashed area,
yielding valid but distinct signatures. If you want to ignore
the unhashed area, you should instead use the
Signature4::normalized_eq
method.
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Signature4> for Signature4
[src]
pub fn partial_cmp(&self, other: &Signature4) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl TryFrom<Signature> for Signature4
[src]
Auto Trait Implementations
impl RefUnwindSafe for Signature4
[src]
impl Send for Signature4
[src]
impl Sync for Signature4
[src]
impl Unpin for Signature4
[src]
impl UnwindSafe for Signature4
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,