Skip to main content

dpp_crypto/keystore/
entry.rs

1//! [`KeyEntry`] — a decrypted, in-memory key pair handed back by the store.
2
3use ed25519_dalek::{SigningKey, VerifyingKey};
4
5use crate::jws::algorithm::KeyAlgorithm;
6
7/// `algorithm` is carried alongside the key material so signing and
8/// verification read it from the key rather than assuming it. The material
9/// itself is Ed25519-typed because Ed25519 is the only algorithm this store
10/// issues; the struct is `#[non_exhaustive]` so that can change without
11/// breaking downstream construction.
12#[non_exhaustive]
13pub struct KeyEntry {
14    pub signing_key: SigningKey,
15    pub verifying_key: VerifyingKey,
16    pub fingerprint: String,
17    /// Whether this key has been revoked (see `KeyRecord::revoked`).
18    pub revoked: bool,
19    pub algorithm: KeyAlgorithm,
20}
21
22impl Drop for KeyEntry {
23    fn drop(&mut self) {
24        // zeroize is called automatically by ed25519_dalek's Drop impl
25    }
26}