Struct pgp::packet::PublicSubkey
source · pub struct PublicSubkey { /* private fields */ }
Implementations§
source§impl PublicSubkey
impl PublicSubkey
sourcepub fn new(
packet_version: Version,
version: KeyVersion,
algorithm: PublicKeyAlgorithm,
created_at: DateTime<Utc>,
expiration: Option<u16>,
public_params: PublicParams
) -> Result<Self>
pub fn new( packet_version: Version, version: KeyVersion, algorithm: PublicKeyAlgorithm, created_at: DateTime<Utc>, expiration: Option<u16>, public_params: PublicParams ) -> Result<Self>
Create a new PublicKeyKey
packet from underlying parameters.
sourcepub fn from_slice(packet_version: Version, input: &[u8]) -> Result<Self>
pub fn from_slice(packet_version: Version, input: &[u8]) -> Result<Self>
Parses a PublicKeyKey
packet from the given slice.
pub fn version(&self) -> KeyVersion
pub fn created_at(&self) -> &DateTime<Utc>
pub fn expiration(&self) -> Option<u16>
pub fn public_params(&self) -> &PublicParams
pub fn verify(&self) -> Result<()>
pub fn sign<F>(&self, key: &impl SecretKeyTrait, key_pw: F) -> Result<Signature>where F: FnOnce() -> String,
Trait Implementations§
source§impl Clone for PublicSubkey
impl Clone for PublicSubkey
source§fn clone(&self) -> PublicSubkey
fn clone(&self) -> PublicSubkey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PublicSubkey
impl Debug for PublicSubkey
source§impl From<PublicSubkey> for Packet
impl From<PublicSubkey> for Packet
source§fn from(other: PublicSubkey) -> Packet
fn from(other: PublicSubkey) -> Packet
Converts to this type from the input type.
source§impl KeyTrait for PublicSubkey
impl KeyTrait for PublicSubkey
source§impl PacketTrait for PublicSubkey
impl PacketTrait for PublicSubkey
source§impl PartialEq<PublicSubkey> for PublicSubkey
impl PartialEq<PublicSubkey> for PublicSubkey
source§fn eq(&self, other: &PublicSubkey) -> bool
fn eq(&self, other: &PublicSubkey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PublicKeyTrait for PublicSubkey
impl PublicKeyTrait for PublicSubkey
source§fn verify_signature(
&self,
hash: HashAlgorithm,
hashed: &[u8],
sig: &[Mpi]
) -> Result<()>
fn verify_signature( &self, hash: HashAlgorithm, hashed: &[u8], sig: &[Mpi] ) -> Result<()>
Verify a signed message.
Data will be hashed using
hash
, before verifying.