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>
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 for PublicSubkey
impl PartialEq 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.source§impl Serialize for PublicSubkey
impl Serialize for PublicSubkey
source§impl TryFrom<Packet> for PublicSubkey
impl TryFrom<Packet> for PublicSubkey
impl Eq for PublicSubkey
impl StructuralPartialEq for PublicSubkey
Auto Trait Implementations§
impl RefUnwindSafe for PublicSubkey
impl Send for PublicSubkey
impl Sync for PublicSubkey
impl Unpin for PublicSubkey
impl UnwindSafe for PublicSubkey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more