#[non_exhaustive]pub enum CredentialError {
IssueeNotFound {
did: String,
},
RegistryError(CredentialRegistryError),
AlreadyRevoked {
said: String,
},
KtThresholdUnsupported,
SchemaUnknown,
StaleOrUnresolvable {
reason: String,
},
CryptoError(AgentError),
}Expand description
Errors from credential issuance, revocation, listing, and verification.
A credential is an ACDC anchored to the issuer’s KEL via a backerless TEL
(vcp/iss/rev). These errors mirror the SDK delegation surfaces:
thiserror only, no anyhow, with an AuthsErrorInfo code + suggestion.
Usage:
match credentials::issue(&ctx, &issuer, issuee, &caps, role, None) {
Err(CredentialError::IssueeNotFound { did }) => { /* issuee has no KEL */ }
Err(e) => return Err(e.into()),
Ok(result) => { /* credential SAID */ }
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
IssueeNotFound
The issuee (subject/holder) has no KEL — an issuee must be incepted before a credential can be issued against it (hard fail, never lazily created).
RegistryError(CredentialRegistryError)
The lazy registry (vcp) inception or a TEL anchor (iss/rev) failed.
AlreadyRevoked
The credential is already revoked — revocation is idempotent, so this is only
surfaced when a caller asks to distinguish “already revoked” from a fresh rev.
KtThresholdUnsupported
The issuer’s KEL is kt≥2 — single-signature credential anchoring only.
SchemaUnknown
The pinned capability schema SAID could not be computed (build-time invariant).
StaleOrUnresolvable
Verification could not reach a fresh-enough witnessed tip to judge the credential’s status — fail-closed (the resolution layer, F.4, owns this).
CryptoError(AgentError)
A cryptographic operation failed (issuer-sign, curve resolution).
Trait Implementations§
Source§impl AuthsErrorInfo for CredentialError
impl AuthsErrorInfo for CredentialError
Source§fn error_code(&self) -> &'static str
fn error_code(&self) -> &'static str
Source§fn suggestion(&self) -> Option<&'static str>
fn suggestion(&self) -> Option<&'static str>
Source§impl Debug for CredentialError
impl Debug for CredentialError
Source§impl Display for CredentialError
impl Display for CredentialError
Source§impl Error for CredentialError
impl Error for CredentialError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<AgentError> for CredentialError
impl From<AgentError> for CredentialError
Source§fn from(err: AgentError) -> Self
fn from(err: AgentError) -> Self
Source§impl From<CredentialRegistryError> for CredentialError
impl From<CredentialRegistryError> for CredentialError
Source§fn from(err: CredentialRegistryError) -> Self
fn from(err: CredentialRegistryError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for CredentialError
impl !UnwindSafe for CredentialError
impl Freeze for CredentialError
impl Send for CredentialError
impl Sync for CredentialError
impl Unpin for CredentialError
impl UnsafeUnpin for CredentialError
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> 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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.