pub struct FederationCredential {
pub subject_agent_id: String,
pub subject_pubkey: [u8; 32],
pub issuer_id: String,
pub trust_domain: String,
pub not_before: i64,
pub not_after: i64,
pub cred_version: u16,
}Expand description
The signed claim set. These fields are what the CA attests to.
Fields§
§subject_agent_id: StringThe node identity this credential vouches for (SPIFFE-style ids
are legal — validate::validate_agent_id already permits the
/ : @ . characters).
subject_pubkey: [u8; 32]The node’s Ed25519 verifying key (raw 32 bytes).
issuer_id: StringIdentity of the CA / intermediate that issued this credential.
trust_domain: StringNamespacing for multi-tenant fleets — the trust domain the subject and issuer both belong to.
not_before: i64Unix seconds; credential invalid before this instant.
not_after: i64Unix seconds; credential invalid after this instant.
cred_version: u16Format version. Equal to CRED_VERSION for credentials this
binary mints.
Implementations§
Source§impl FederationCredential
impl FederationCredential
Sourcepub fn canonical_claims_bytes(&self) -> Result<Vec<u8>, CredentialError>
pub fn canonical_claims_bytes(&self) -> Result<Vec<u8>, CredentialError>
Canonical CBOR of the claim set. Deterministic: a BTreeMap
enforces lexicographic key order and ciborium emits
definite-length, smallest-int encodings. Same convention as
crate::identity::sign::canonical_cbor.
§Errors
Returns CredentialError::Malformed only on an internal
serialisation fault (not reachable with well-formed fields).
Sourcepub fn sign(
&self,
ca_signing_key: &SigningKey,
) -> Result<SignedCredential, CredentialError>
pub fn sign( &self, ca_signing_key: &SigningKey, ) -> Result<SignedCredential, CredentialError>
Sign this credential with the issuer’s CA signing key, producing a
SignedCredential that carries the exact signed bytes.
§Errors
Propagates CredentialError::Malformed from claim encoding.
Sourcepub fn subject_verifying_key(&self) -> Result<VerifyingKey, CredentialError>
pub fn subject_verifying_key(&self) -> Result<VerifyingKey, CredentialError>
The subject’s verifying key, decoded from subject_pubkey.
§Errors
CredentialError::BadSubjectKey when the bytes are not a valid
Edwards-curve point.
Trait Implementations§
Source§impl Clone for FederationCredential
impl Clone for FederationCredential
Source§fn clone(&self) -> FederationCredential
fn clone(&self) -> FederationCredential
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FederationCredential
impl Debug for FederationCredential
impl Eq for FederationCredential
Source§impl PartialEq for FederationCredential
impl PartialEq for FederationCredential
Source§fn eq(&self, other: &FederationCredential) -> bool
fn eq(&self, other: &FederationCredential) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FederationCredential
Auto Trait Implementations§
impl Freeze for FederationCredential
impl RefUnwindSafe for FederationCredential
impl Send for FederationCredential
impl Sync for FederationCredential
impl Unpin for FederationCredential
impl UnsafeUnpin for FederationCredential
impl UnwindSafe for FederationCredential
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more