pub trait CredentialT: CredentialSealed {
type Properties;
// Required methods
fn context(&self) -> &OneOrMany<Context>;
fn type_(&self) -> &OneOrMany<String>;
fn subject(&self) -> &OneOrMany<Subject>;
fn issuer(&self) -> &Issuer;
fn valid_from(&self) -> Timestamp;
fn valid_until(&self) -> Option<Timestamp>;
fn status(&self) -> Option<&Status>;
fn properties(&self) -> &Self::Properties;
fn non_transferable(&self) -> bool;
fn base_context(&self) -> &'static Context;
fn serialize_jwt(
&self,
custom_claims: Option<BTreeMap<String, Value>>,
) -> Result<String, Error>;
}Expand description
A VerifiableCredential type. This trait is implemented for Credential and for CredentialV2.
Required Associated Types§
Sourcetype Properties
type Properties
The type of the custom claims.
Required Methods§
Sourcefn valid_from(&self) -> Timestamp
fn valid_from(&self) -> Timestamp
The Credential’s issuance date.
Sourcefn valid_until(&self) -> Option<Timestamp>
fn valid_until(&self) -> Option<Timestamp>
The Credential’s expiration date, if any.
Sourcefn properties(&self) -> &Self::Properties
fn properties(&self) -> &Self::Properties
The Credential’s custom properties.
Sourcefn non_transferable(&self) -> bool
fn non_transferable(&self) -> bool
Whether the Credential’s nonTransferable property is set.
Sourcefn base_context(&self) -> &'static Context
fn base_context(&self) -> &'static Context
The Credential’s base context.