Struct pbp::PgpSig [−][src]
pub struct PgpSig { /* fields omitted */ }
An OpenPGP formatted ed25519 signature.
Methods
impl PgpSig
[src]
impl PgpSig
pub fn new<Sha256, F>(
data: &[u8],
fingerprint: Fingerprint,
sig_type: SigType,
subpackets: &[SubPacket],
sign: F
) -> PgpSig where
Sha256: Digest<OutputSize = U32>,
F: Fn(&[u8]) -> Signature,
[src]
pub fn new<Sha256, F>(
data: &[u8],
fingerprint: Fingerprint,
sig_type: SigType,
subpackets: &[SubPacket],
sign: F
) -> PgpSig where
Sha256: Digest<OutputSize = U32>,
F: Fn(&[u8]) -> Signature,
Construct a new PGP signature.
This will construct a valid OpenPGP signature using the ed25519 signing algorithm & SHA-256 hashing algorithm. It will contain these hashed subpackets:
- A version 4 key fingerprint
- A timestamp
- Whatever subpackets you pass as arguments
It will contain the key id as an unhashed subpacket.
pub fn from_bytes(bytes: &[u8]) -> Result<PgpSig, PgpError>
[src]
pub fn from_bytes(bytes: &[u8]) -> Result<PgpSig, PgpError>
Parse an OpenPGP signature from binary data.
This must be an ed25519 signature using SHA-256 for hashing, and it must be in the subset of OpenPGP supported by this library.
pub fn from_ascii_armor(string: &str) -> Result<PgpSig, PgpError>
[src]
pub fn from_ascii_armor(string: &str) -> Result<PgpSig, PgpError>
Parse an OpenPGP signature from ASCII armored data.
pub fn as_bytes(&self) -> &[u8]
[src]
pub fn as_bytes(&self) -> &[u8]
Get the binary representation of this signature.
pub fn hashed_section(&self) -> &[u8]
[src]
pub fn hashed_section(&self) -> &[u8]
Get the portion of this signature hashed into the signed data.
pub fn signature(&self) -> Signature
[src]
pub fn signature(&self) -> Signature
Get the actual ed25519 signature contained.
pub fn fingerprint(&self) -> Fingerprint
[src]
pub fn fingerprint(&self) -> Fingerprint
Get the fingerprint of the public key which made this signature.
pub fn sig_type(&self) -> SigType
[src]
pub fn sig_type(&self) -> SigType
Get the type of this signature.
pub fn verify<Sha256, F1, F2>(&self, input: F1, verify: F2) -> bool where
Sha256: Digest<OutputSize = U32>,
F1: FnOnce(&mut Sha256),
F2: FnOnce(&[u8], Signature) -> bool,
[src]
pub fn verify<Sha256, F1, F2>(&self, input: F1, verify: F2) -> bool where
Sha256: Digest<OutputSize = U32>,
F1: FnOnce(&mut Sha256),
F2: FnOnce(&[u8], Signature) -> bool,
Verify data against this signature.
The data to be verified should be inputed by hashing it into the SHA-256 hasher using the input function.
Trait Implementations
impl Eq for PgpSig
[src]
impl Eq for PgpSig
impl PartialEq for PgpSig
[src]
impl PartialEq for PgpSig
fn eq(&self, other: &PgpSig) -> bool
[src]
fn eq(&self, other: &PgpSig) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &PgpSig) -> bool
[src]
fn ne(&self, other: &PgpSig) -> bool
This method tests for !=
.
impl Hash for PgpSig
[src]
impl Hash for PgpSig
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for PgpSig
[src]
impl Debug for PgpSig
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Display for PgpSig
[src]
impl Display for PgpSig
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl FromStr for PgpSig
[src]
impl FromStr for PgpSig