[][src]Module caelum_vcdm::verifiable_presentation

Struct representing a verifiablePresentation explained in w3's verifiable credentials data model documentation.

Id

verifiablePresentations MUST have exactly one DID id. This attribute has to be a valid DID, and when registered, the registered DID MUST mathis this DID. This is why when constructing a new VerifiablePresentation(id) a valid DID must be passed as argument. This value can be OVERWRITTEN using method self.set_id(id) passing a new valid DID as argument.

Context

verifiablePresentations MUST have exactly one top-level @context statement. This context must be given as a valid URL for the generic DID context. By default the following context is created when creating a new verifiablePresentation:

"@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://www.w3.org/2018/credentials/examples/v1"
]

More contexts can be added to the array using method self.set_context(new_context).

Type

For the present usage of this crate, the type attribute is also set by default as follows:

"type": [
   "VerifiableCredential",
   "PersonalInformation"
 ]

As before, other types can be added to the array using method self.set_type(new_type). Being new_type the element to add to the array.

Verifiable credential

Attribute verifiable_credential MUST be created with the help of the module VerifiableCredential. To set this attribute the method self.set_verifiable_credential() must be used and a valid VerifiableCredential object must be given. By default, the constructor will leave this attribute as an empty array. This attribute may have several valid VerifiableCredentials, that can be pushed using method self.set_verifiable_credential(). For more information please look at VerifiableCredential documentation.

Proof

A proof on a DID Document is cryptographic proof of the integrity of the DID Document. Following the definition given in w3 documentation. A DID Document MAY have exactly one property representing a proof. To set a Proof to a VerifiablePresentation method self.set_proof() must be used passing arguments:

  1. verificationMethod (String): argument is concatenated to variable self.issuer. (HAS TO CHANGE)
  2. type (String): A URI that identifies the digital signature suite that was used to create the signature. This attribute is not passed to the method and forced to be RSAsignature2018.
  3. created (String): date creation of the proof, with format YYYY-mm-ddThh:mm:ssZ.
  4. signatureValue (String): The value of the signature value generated by the type algorithm.

Structs

VerifiablePresentation