ais_keystore_lib/key_store/key.rs
1//! Definitions for key records stored in the key store.
2// use dusa_collection_utils::stringy::Stringy;
3use serde::{Deserialize, Serialize};
4
5#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, PartialOrd, Ord, Eq)]
6/// Indicates the current lifecycle stage of a key.
7pub enum KeyStatus {
8 Active,
9 NearExpiration,
10 Expired,
11 Invalid,
12}
13
14#[derive(Serialize, Deserialize, Debug, Clone)]
15/// Representation of a cryptographic key and its metadata.
16pub struct Key {
17 pub id: String,
18 pub value: Vec<u8>,
19 // pub hash: Stringy,
20 pub legnth: usize,
21 pub ttl: u64,
22 pub created_at: u64,
23 pub expires_at: u64,
24 pub version: u32,
25 pub status: KeyStatus,
26}