Skip to main content

SigningKey

Struct SigningKey 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§kid: String

Stable 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: PrincipalId

Service 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

Source

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

Source§

fn clone(&self) -> SigningKey

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SigningKey

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SigningKey

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for SigningKey

Source§

impl PartialEq for SigningKey

Source§

fn eq(&self, other: &SigningKey) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SigningKey

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SigningKey

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.