pub struct PublicKey { /* private fields */ }
Implementations§
source§impl PublicKey
impl PublicKey
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 PacketTrait for PublicKey
impl PacketTrait for PublicKey
source§impl PartialEq for PublicKey
impl PartialEq for PublicKey
source§impl PublicKeyTrait for PublicKey
impl PublicKeyTrait for PublicKey
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.impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
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