struct HsmKey<'a, 'b> {
public_key: PublicKey,
nethsm: &'a NetHsm,
key_id: &'b KeyId,
}
Expand description
PGP-adapter for a NetHSM key.
All PGP-related operations executed on objects of this type will be forwarded to the NetHSM instance.
Fields§
§public_key: PublicKey
§nethsm: &'a NetHsm
§key_id: &'b KeyId
Implementations§
Trait Implementations§
source§impl PublicKeyTrait for HsmKey<'_, '_>
impl PublicKeyTrait for HsmKey<'_, '_>
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: CryptoRng + Rng>(
&self,
rng: R,
plain: &[u8],
esk_type: EskType,
) -> Result<PkeskBytes>
fn encrypt<R: CryptoRng + Rng>( &self, rng: R, plain: &[u8], esk_type: 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 version(&self) -> KeyVersion
fn fingerprint(&self) -> Fingerprint
fn algorithm(&self) -> PublicKeyAlgorithm
fn created_at(&self) -> &DateTime<Utc>
fn expiration(&self) -> Option<u16>
fn public_params(&self) -> &PublicParams
fn is_signing_key(&self) -> bool
fn is_encryption_key(&self) -> bool
source§impl SecretKeyTrait for HsmKey<'_, '_>
impl SecretKeyTrait for HsmKey<'_, '_>
Auto Trait Implementations§
impl<'a, 'b> Freeze for HsmKey<'a, 'b>
impl<'a, 'b> !RefUnwindSafe for HsmKey<'a, 'b>
impl<'a, 'b> !Send for HsmKey<'a, 'b>
impl<'a, 'b> !Sync for HsmKey<'a, 'b>
impl<'a, 'b> Unpin for HsmKey<'a, 'b>
impl<'a, 'b> !UnwindSafe for HsmKey<'a, 'b>
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