Credential

Trait Credential 

Source
pub trait Credential {
    type Subject;
    type Issuer: ?Sized + Identified;
    type Status: Identified + Typed;
    type RefreshService: Identified + Typed;
    type TermsOfUse: MaybeIdentified + Typed;
    type Evidence: MaybeIdentified + Typed;
    type Schema: Identified + Typed;

Show 13 methods // Required methods fn issuer(&self) -> &Self::Issuer; fn issuance_date(&self) -> Option<DateTime>; // Provided methods fn id(&self) -> Option<&Uri> { ... } fn additional_types(&self) -> &[String] { ... } fn types(&self) -> CredentialTypes<'_> { ... } fn credential_subjects(&self) -> &[Self::Subject] { ... } fn expiration_date(&self) -> Option<DateTime> { ... } fn credential_status(&self) -> &[Self::Status] { ... } fn refresh_services(&self) -> &[Self::RefreshService] { ... } fn terms_of_use(&self) -> &[Self::TermsOfUse] { ... } fn evidence(&self) -> &[Self::Evidence] { ... } fn credential_schemas(&self) -> &[Self::Schema] { ... } fn validate_credential<E>(&self, env: &E) -> ClaimsValidity where E: DateTimeProvider { ... }
}
Expand description

Credential trait.

Required Associated Types§

Source

type Subject

Credential subject type.

Source

type Issuer: ?Sized + Identified

Issuer type.

Source

type Status: Identified + Typed

Credential status type.

Source

type RefreshService: Identified + Typed

Source

type TermsOfUse: MaybeIdentified + Typed

Terms of Use type.

Terms of use can be utilized by an issuer or a holder to communicate the terms under which a verifiable credential or verifiable presentation was issued.

Source

type Evidence: MaybeIdentified + Typed

Evidence type.

Can be included by an issuer to provide the verifier with additional supporting information in a verifiable credential.

Source

type Schema: Identified + Typed

Credential Schemas (Zero-Knowledge Proofs).

See: https://www.w3.org/TR/vc-data-model//#zero-knowledge-proofs

Required Methods§

Source

fn issuer(&self) -> &Self::Issuer

Issuer.

This property is required for the credential to be verifiable.

Source

fn issuance_date(&self) -> Option<DateTime>

Issuance date.

This property is required for the credential to be verifiable.

Provided Methods§

Source

fn id(&self) -> Option<&Uri>

Identifier.

Source

fn additional_types(&self) -> &[String]

Types that are not VerifiableCredential.

Since the VerifiableCredential type is required, it is omitted from the value returned by this function. If you need to iterate over all the credential types, including VerifiableCredential, use the Self::types method.

Source

fn types(&self) -> CredentialTypes<'_>

Source

fn credential_subjects(&self) -> &[Self::Subject]

Credential subject.

Source

fn expiration_date(&self) -> Option<DateTime>

Expiration date.

Source

fn credential_status(&self) -> &[Self::Status]

Credential status.

Used for discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked.

Source

fn refresh_services(&self) -> &[Self::RefreshService]

Source

fn terms_of_use(&self) -> &[Self::TermsOfUse]

Terms of Use.

Terms of use can be utilized by an issuer or a holder to communicate the terms under which a verifiable credential or verifiable presentation was issued.

Source

fn evidence(&self) -> &[Self::Evidence]

Evidence.

Can be included by an issuer to provide the verifier with additional supporting information in a verifiable credential.

Source

fn credential_schemas(&self) -> &[Self::Schema]

Credential Schemas (Zero-Knowledge Proofs).

See: https://www.w3.org/TR/vc-data-model//#zero-knowledge-proofs

Source

fn validate_credential<E>(&self, env: &E) -> ClaimsValidity

Validates the credential.

Validation consists in verifying that the claims themselves are consistent and valid with regard to the verification environment. For instance, checking that a credential’s expiration date is not in the past, or the issue date not in the future.

Validation may fail even if the credential proof is successfully verified.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Credential, S: CryptographicSuite> Credential for DataIntegrity<T, S>

Implementors§

Source§

impl<Subject, RequiredContext, RequiredType, Issuer: Identified, Status: Identified + Typed, Evidence: MaybeIdentified + Typed, Schema: Identified + Typed, RefreshService: Identified + Typed, TermsOfUse: MaybeIdentified + Typed, ExtraProperties> Credential for SpecializedJsonCredential<Subject, RequiredContext, RequiredType, Issuer, Status, Evidence, Schema, RefreshService, TermsOfUse, ExtraProperties>

Source§

type Subject = Subject

Source§

type Issuer = Issuer

Source§

type Status = Status

Source§

type RefreshService = RefreshService

Source§

type TermsOfUse = TermsOfUse

Source§

type Evidence = Evidence

Source§

type Schema = Schema