pub struct SecretKey { /* private fields */ }
Implementations§
source§impl SecretKey
impl SecretKey
sourcepub fn from_slice(packet_version: Version, input: &[u8]) -> Result<Self>
pub fn from_slice(packet_version: Version, input: &[u8]) -> Result<Self>
Parses a SecretKey
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 secret_params(&self) -> &SecretParams
sourcepub fn has_sha1_checksum(&self) -> bool
pub fn has_sha1_checksum(&self) -> bool
Checks if we should expect a SHA1 checksum in the encrypted part.
pub fn sign<F>(&self, key: &impl SecretKeyTrait, key_pw: F) -> Result<Signature>where F: FnOnce() -> String,
Trait Implementations§
source§impl PacketTrait for SecretKey
impl PacketTrait for SecretKey
source§impl PartialEq<SecretKey> for SecretKey
impl PartialEq<SecretKey> for SecretKey
source§impl PublicKeyTrait for SecretKey
impl PublicKeyTrait for SecretKey
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 SecretKeyTrait for SecretKey
impl SecretKeyTrait for SecretKey
source§fn unlock<F, G>(&self, pw: F, work: G) -> Result<()>where
F: FnOnce() -> String,
G: FnOnce(&SecretKeyRepr) -> Result<()>,
fn unlock<F, G>(&self, pw: F, work: G) -> Result<()>where F: FnOnce() -> String, G: FnOnce(&SecretKeyRepr) -> Result<()>,
Unlock the raw data in the secret parameters.