[−][src]Struct sequoia_openpgp::packet::signature::Signature4
Holds a signature packet.
Signature packets are used both for certification purposes as well as for document signing purposes.
See Section 5.2 of RFC 4880 for details.
Methods
impl Signature4
[src]
pub fn version(&self) -> u8
[src]
Gets the version.
pub fn typ(&self) -> SignatureType
[src]
Gets the signature type.
pub fn pk_algo(&self) -> PublicKeyAlgorithm
[src]
Gets the public key algorithm.
pub fn hash_algo(&self) -> HashAlgorithm
[src]
Gets the hash algorithm.
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 Builder
interface.
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.
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.
Methods from Deref<Target = Builder>
pub fn version(&self) -> u8
[src]
Gets the version.
pub fn typ(&self) -> SignatureType
[src]
Gets the signature type.
pub fn pk_algo(&self) -> PublicKeyAlgorithm
[src]
Gets the public key algorithm.
pub fn hash_algo(&self) -> HashAlgorithm
[src]
Gets the hash algorithm.
Trait Implementations
impl Clone for Signature4
[src]
fn clone(&self) -> Signature4
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Signature4
[src]
impl Deref for Signature4
[src]
impl DerefMut for Signature4
[src]
impl Eq for Signature4
[src]
impl<'a> From<&'a Signature4> for &'a Builder
[src]
fn from(sig: &'a Signature4) -> Self
[src]
impl From<Signature4> for Builder
[src]
fn from(sig: Signature4) -> Self
[src]
impl From<Signature4> for Packet
[src]
fn from(s: Signature4) -> Self
[src]
impl From<Signature4> for Signature
[src]
fn from(s: Signature4) -> Self
[src]
impl Hash for Signature4
[src]
impl Hash for Signature4
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Signature4> for Signature4
[src]
fn eq(&self, other: &Signature4) -> bool
[src]
This method tests for self and other values to be equal, and is used by ==.
Note: We ignore the unhashed subpacket area when comparing signatures. This prevents a malicious party to take valid signatures, add subpackets to the unhashed area, yielding valid but distinct signatures.
The problem we are trying to avoid here is signature spamming. Ignoring the unhashed subpackets means that we can deduplicate signatures using this predicate.
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Signature4
[src]
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.
fn export(&self, o: &mut dyn Write) -> Result<()>
[src]
impl SerializeInto for Signature4
[src]
Auto Trait Implementations
impl RefUnwindSafe for Signature4
impl Send for Signature4
impl Sync for Signature4
impl Unpin for Signature4
impl UnwindSafe for Signature4
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,
fn borrow_mut(&mut self) -> &mut T
[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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,