[][src]Struct didkit::VerifiableCredential

pub struct VerifiableCredential {
    pub context: Contexts,
    pub id: Option<URI>,
    pub type_: OneOrMany<String>,
    pub credential_subject: OneOrMany<CredentialSubject>,
    pub issuer: Option<Issuer>,
    pub issuance_date: Option<DateTime<Utc>>,
    pub proof: Option<OneOrMany<Proof>>,
    pub expiration_date: Option<DateTime<Utc>>,
    pub credential_status: Option<Status>,
    pub terms_of_use: Option<Vec<TermsOfUse, Global>>,
    pub evidence: Option<OneOrMany<Evidence>>,
    pub credential_schema: Option<OneOrMany<Schema>>,
    pub refresh_service: Option<OneOrMany<RefreshService>>,
    pub property_set: Option<HashMap<String, Value, RandomState>>,
}

Fields

context: Contextsid: Option<URI>type_: OneOrMany<String>credential_subject: OneOrMany<CredentialSubject>issuer: Option<Issuer>issuance_date: Option<DateTime<Utc>>proof: Option<OneOrMany<Proof>>expiration_date: Option<DateTime<Utc>>credential_status: Option<Status>terms_of_use: Option<Vec<TermsOfUse, Global>>evidence: Option<OneOrMany<Evidence>>credential_schema: Option<OneOrMany<Schema>>refresh_service: Option<OneOrMany<RefreshService>>property_set: Option<HashMap<String, Value, RandomState>>

Implementations

impl Credential[src]

pub fn from_json(s: &str) -> Result<Credential, Error>[src]

pub fn from_json_unsigned(s: &str) -> Result<Credential, Error>[src]

pub fn from_jwt_keys(jwt: &str, keys: &JWTKeys) -> Result<Credential, Error>[src]

pub fn from_jwt(jwt: &str, key: &JWK) -> Result<Credential, Error>[src]

pub fn from_jwt_unsigned(jwt: &str) -> Result<Credential, Error>[src]

pub fn from_jwt_claims(claims: JWTClaims) -> Result<Credential, Error>[src]

pub fn encode_jwt_unsigned(&self, aud: &str) -> Result<String, Error>[src]

pub fn encode_sign_jwt(
    &self,
    keys: &JWTKeys,
    aud: &str
) -> Result<String, Error>
[src]

pub fn validate_unsigned(&self) -> Result<(), Error>[src]

pub fn is_zkp(&self) -> bool[src]

pub fn validate(&self) -> Result<(), Error>[src]

pub async fn verify(
    &'_ self,
    options: Option<LinkedDataProofOptions>,
    resolver: &'_ (dyn DIDResolver + '_)
) -> VerificationResult
[src]

pub async fn generate_proof(
    &'_ self,
    jwk: &'_ JWK,
    options: &'_ LinkedDataProofOptions
) -> Result<Proof, Error>
[src]

pub async fn prepare_proof(
    &'_ self,
    public_key: &'_ JWK,
    options: &'_ LinkedDataProofOptions
) -> Result<ProofPreparation, Error>
[src]

Prepare to generate a linked data proof. Returns the signing input for the caller to sign and then pass to ProofPreparation::complete to complete the proof.

pub fn add_proof(&mut self, proof: Proof)[src]

Trait Implementations

impl Clone for Credential[src]

impl Debug for Credential[src]

impl<'de> Deserialize<'de> for Credential[src]

impl LinkedDataDocument for Credential[src]

impl Serialize for Credential[src]

Auto Trait Implementations

impl RefUnwindSafe for Credential[src]

impl Send for Credential[src]

impl Sync for Credential[src]

impl Unpin for Credential[src]

impl UnwindSafe for Credential[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Desc<'a, T> for T

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

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToOwned for T

type Owned = T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,