#[non_exhaustive]pub struct SigningKey {
pub kid: String,
pub principal_id: PrincipalId,
pub public_key: [u8; 32],
pub status: SigningKeyStatus,
pub created_at: i64,
pub retire_at: Option<i64>,
}Expand description
One Ed25519 keypair (public half + lifecycle metadata) belonging to a service principal.
public_key is the raw 32-byte Ed25519 public key (PASETO V4’s
AsymmetricPublicKey<V4>::as_bytes() shape). It is the only key half cheers
retains: the secret half is returned exactly once at provision/rotate time
in ProvisionedKey::secret_key and never again.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kid: StringStable opaque identifier — the JWKS rotation handle. Unique across
the JWKS (not just within one principal); kamaji matches against
kid and falls back to a rate-limited refresh on unknown values.
principal_id: PrincipalIdService principal this key signs for. kind is always
PrincipalKind::Service — provision/rotate refuse other kinds at
the authority layer.
public_key: [u8; 32]Raw Ed25519 public key — 32 bytes. Serialized to the JWKS as base64url; in this struct kept as the byte array so a JWKS publisher (R020-F11) doesn’t have to re-decode.
status: SigningKeyStatus§created_at: i64§retire_at: Option<i64>None while the key is Active. Set to the unix-second drop time
when the key transitions to Retiring —
prune_retired_keys
removes rows whose retire_at <= now.
Implementations§
Source§impl SigningKey
impl SigningKey
Sourcepub fn new(
kid: impl Into<String>,
principal_id: PrincipalId,
public_key: [u8; 32],
status: SigningKeyStatus,
created_at: i64,
retire_at: Option<i64>,
) -> Self
pub fn new( kid: impl Into<String>, principal_id: PrincipalId, public_key: [u8; 32], status: SigningKeyStatus, created_at: i64, retire_at: Option<i64>, ) -> Self
Build a SigningKey from its persisted parts.
Provided so external ServicePrincipalStore impls (cheers-sqlx,
cheers-redis, …) can reconstruct rows without depending on the
#[non_exhaustive] struct expression — that compiles only from
inside this crate.
Trait Implementations§
Source§impl Clone for SigningKey
impl Clone for SigningKey
Source§fn clone(&self) -> SigningKey
fn clone(&self) -> SigningKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more