enum SignedPublicKeyOrSubkey<'a> {
Key(&'a SignedPublicKey),
Subkey(&'a SignedPublicSubKey),
}
Expand description
A wrapper for rPGP public key types
Variants§
Key(&'a SignedPublicKey)
Subkey(&'a SignedPublicSubKey)
Trait Implementations§
source§impl<'a> Debug for SignedPublicKeyOrSubkey<'a>
impl<'a> Debug for SignedPublicKeyOrSubkey<'a>
source§impl PublicKeyTrait for SignedPublicKeyOrSubkey<'_>
impl PublicKeyTrait for SignedPublicKeyOrSubkey<'_>
fn version(&self) -> KeyVersion
fn fingerprint(&self) -> Fingerprint
fn algorithm(&self) -> PublicKeyAlgorithm
fn created_at(&self) -> &DateTime<Utc>
fn expiration(&self) -> Option<u16>
source§fn verify_signature(
&self,
hash: HashAlgorithm,
data: &[u8],
sig: &SignatureBytes,
) -> Result<()>
fn verify_signature( &self, hash: HashAlgorithm, data: &[u8], sig: &SignatureBytes, ) -> Result<()>
Verify a signed message.
Data will be hashed using
hash
, before verifying.source§fn encrypt<R: Rng + CryptoRng>(
&self,
rng: R,
plain: &[u8],
typ: EskType,
) -> Result<PkeskBytes>
fn encrypt<R: Rng + CryptoRng>( &self, rng: R, plain: &[u8], typ: EskType, ) -> Result<PkeskBytes>
Encrypt the given
plain
for this key.source§fn serialize_for_hashing(&self, writer: &mut impl Write) -> Result<()>
fn serialize_for_hashing(&self, writer: &mut impl Write) -> Result<()>
This is the data used for hashing in a signature. Only uses the public portion of the key.
fn public_params(&self) -> &PublicParams
fn is_signing_key(&self) -> bool
fn is_encryption_key(&self) -> bool
Auto Trait Implementations§
impl<'a> Freeze for SignedPublicKeyOrSubkey<'a>
impl<'a> RefUnwindSafe for SignedPublicKeyOrSubkey<'a>
impl<'a> Send for SignedPublicKeyOrSubkey<'a>
impl<'a> Sync for SignedPublicKeyOrSubkey<'a>
impl<'a> Unpin for SignedPublicKeyOrSubkey<'a>
impl<'a> UnwindSafe for SignedPublicKeyOrSubkey<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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