pub struct SignedSecretSubKey {
pub key: SecretSubkey,
pub signatures: Vec<Signature>,
}
Expand description
Represents a composed secret PGP SubKey.
Fields§
§key: SecretSubkey
§signatures: Vec<Signature>
Implementations§
Source§impl SignedSecretSubKey
impl SignedSecretSubKey
pub fn new(key: SecretSubkey, signatures: Vec<Signature>) -> Self
pub fn verify(&self, key: &impl PublicKeyTrait) -> Result<()>
Trait Implementations§
Source§impl Clone for SignedSecretSubKey
impl Clone for SignedSecretSubKey
Source§fn clone(&self) -> SignedSecretSubKey
fn clone(&self) -> SignedSecretSubKey
Returns a duplicate 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 SignedSecretSubKey
impl Debug for SignedSecretSubKey
Source§impl From<SignedSecretSubKey> for SignedPublicSubKey
impl From<SignedSecretSubKey> for SignedPublicSubKey
Source§fn from(value: SignedSecretSubKey) -> Self
fn from(value: SignedSecretSubKey) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SignedSecretSubKey
impl PartialEq for SignedSecretSubKey
Source§impl PublicKeyTrait for SignedSecretSubKey
impl PublicKeyTrait for SignedSecretSubKey
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 version(&self) -> KeyVersion
fn fingerprint(&self) -> Fingerprint
fn algorithm(&self) -> PublicKeyAlgorithm
fn created_at(&self) -> &DateTime<Utc>
fn expiration(&self) -> Option<u16>
fn is_signing_key(&self) -> bool
fn is_encryption_key(&self) -> bool
Source§impl SecretKeyTrait for SignedSecretSubKey
impl SecretKeyTrait for SignedSecretSubKey
type PublicKey = PublicSubkey
Source§type Unlocked = SecretKeyRepr
type Unlocked = SecretKeyRepr
The type representing the unlocked version of this.
Source§fn unlock<F, G, T>(&self, pw: F, work: G) -> Result<T>
fn unlock<F, G, T>(&self, pw: F, work: G) -> Result<T>
Unlock the raw data in the secret parameters.
fn create_signature<F>( &self, key_pw: F, hash: HashAlgorithm, data: &[u8], ) -> Result<SignatureBytes>
fn public_key(&self) -> Self::PublicKey
Source§fn hash_alg(&self) -> HashAlgorithm
fn hash_alg(&self) -> HashAlgorithm
The suggested hash algorithm to calculate the signature hash digest with, when using this
key as a signer
Source§impl Serialize for SignedSecretSubKey
impl Serialize for SignedSecretSubKey
impl Eq for SignedSecretSubKey
impl StructuralPartialEq for SignedSecretSubKey
Auto Trait Implementations§
impl Freeze for SignedSecretSubKey
impl RefUnwindSafe for SignedSecretSubKey
impl Send for SignedSecretSubKey
impl Sync for SignedSecretSubKey
impl Unpin for SignedSecretSubKey
impl UnwindSafe for SignedSecretSubKey
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