[][src]Struct caelum_vcdm::verifiable_credential::VerifiableCredential

pub struct VerifiableCredential {
    pub context: Vec<String>,
    pub credential_type: Vec<String>,
    pub claims: Vec<Claim>,
    pub id: String,
    pub issuer: String,
    pub proofs: Vec<Proof>,
    pub non_revocation_proof: Vec<NonRevocationProof>,
}

Fields

context: Vec<String>credential_type: Vec<String>claims: Vec<Claim>id: Stringissuer: Stringproofs: Vec<Proof>non_revocation_proof: Vec<NonRevocationProof>

Methods

impl VerifiableCredential[src]

pub fn new(id: String) -> Self[src]

Rust Verifiable Credential Constructor

VerifiableCredential's constructor will create an empty VerifiableCredential object. By default properties context and credential_type are set. With "my_id" as an id the following structure is given:

{
    context: [
        "https://www.w3.org/2018/credentials/v1",
        "https://www.w3.org/2018/credentials/examples/v1"
    ],
    type: ["VerifiableCredential", "PersonalInformation"],
    id: "id_credential",
    claims: [{
        id: "",
        credentialStatus: { id: "", type: "" },
        credentialSubject: [{
            email: "example@example.com"
        }],
        issuer: "",
        issuanceDate: "",
        type: ["VerifiableCredential", "PersonalInformation"],
    }],
    proofs: [{
        type: "",
        created: "",
        verificationMethod: "",
        signatureValue: ""
    }],
    nonRevocationProof: [{
        type: "",
        created: "",
        verificationMethod: "",
        signatureValue: ""
    }]
}

Note: An empty object is not a valid VerifiableCredential.

pub fn to_json(&self) -> JsValue[src]

pub fn to_str(&self) -> String[src]

Trait Implementations

impl Clone for VerifiableCredential[src]

impl Default for VerifiableCredential[src]

impl Debug for VerifiableCredential[src]

impl Serialize for VerifiableCredential[src]

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

Auto Trait Implementations

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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

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<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T> Same<T> for T

type Output = T

Should always be Self