pub struct OnePassSignature {
pub packet_version: Version,
pub typ: SignatureType,
pub hash_algorithm: HashAlgorithm,
pub pub_algorithm: PublicKeyAlgorithm,
pub last: u8,
pub version_specific: OpsVersionSpecific,
}
Expand description
One-Pass Signature Packet https://www.rfc-editor.org/rfc/rfc9580.html#name-one-pass-signature-packet-t
A One-Pass Signature Packet acts as a companion to a Signature Packet. In modern OpenPGP messages, Ops and Signatures occur in pairs, bracketing the message payload.
The Ops packet contains all the information that a recipient needs to calculate the hash digest for the signature. This enables the recipient to process the message in “one pass”, calculating the hash digest based on the Ops Packet (which occurs before the message payload), and validating the cryptographic signature in the Signature Packet (which occurs after the message payload) after hashing is completed.
Fields§
§packet_version: Version
§typ: SignatureType
§hash_algorithm: HashAlgorithm
§pub_algorithm: PublicKeyAlgorithm
§last: u8
§version_specific: OpsVersionSpecific
Implementations§
Source§impl OnePassSignature
impl OnePassSignature
Sourcepub fn from_slice(packet_version: Version, input: &[u8]) -> Result<Self>
pub fn from_slice(packet_version: Version, input: &[u8]) -> Result<Self>
Parses a OnePassSignature
packet from the given slice.
Sourcepub fn v3(
typ: SignatureType,
hash_algorithm: HashAlgorithm,
pub_algorithm: PublicKeyAlgorithm,
key_id: KeyId,
) -> Self
pub fn v3( typ: SignatureType, hash_algorithm: HashAlgorithm, pub_algorithm: PublicKeyAlgorithm, key_id: KeyId, ) -> Self
Constructor for a v3 one pass signature packet.
RFC 4880-era OpenPGP uses v3 one pass signature packets (NOTE: there is no v4 OPS)
“When generating a one-pass signature, the OPS packet version MUST correspond to the version of the associated Signature packet, except for the historical accident that version 4 keys use a version 3 One-Pass Signature packet (there is no version 4 OPS).”
https://www.rfc-editor.org/rfc/rfc9580.html#name-one-pass-signature-packet-t
Sourcepub fn v6(
typ: SignatureType,
hash_algorithm: HashAlgorithm,
pub_algorithm: PublicKeyAlgorithm,
salt: Vec<u8>,
fingerprint: [u8; 32],
) -> Self
pub fn v6( typ: SignatureType, hash_algorithm: HashAlgorithm, pub_algorithm: PublicKeyAlgorithm, salt: Vec<u8>, fingerprint: [u8; 32], ) -> Self
Constructor for a v6 one pass signature packet.
Version 6 OpenPGP signatures must be combined with v6 one pass signature packets.
https://www.rfc-editor.org/rfc/rfc9580.html#name-one-pass-signature-packet-t
Trait Implementations§
Source§impl Clone for OnePassSignature
impl Clone for OnePassSignature
Source§fn clone(&self) -> OnePassSignature
fn clone(&self) -> OnePassSignature
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more