VcDataModelV1 class

Represents a Verifiable Credential (VC) according to the W3C VC Data Model v1.1.

A Verifiable Credential (VC) is a digitally signed statement, issued by issuer

This class supports JSON serialization and deserialization for interoperability. Example:

VcDataModelV1(
 context: [
   'https://www.w3.org/2018/credentials/v1',
   'https://schema.affinidi.com/UserProfileV1-0.jsonld'
 ],
 id: Uri.parse('uuid:123456abcd'),
 type: {'VerifiableCredential', 'UserProfile'},
 credentialSubject: [
   CredentialSubject({
     'Fname': 'Fname',
     'Lname': 'Lame',
     'Age': '22',
     'Address': 'Eihhornstr'
   })
  ],
 holder: Holder.uri('did:example:1'),
 credentialSchema: [
   CredentialSchema(
       id: Uri.parse('https://schema.affinidi.com/UserProfileV1-0.json'),
       type: 'JsonSchemaValidator2018')
 ],
 issuanceDate: DateTime.now(),
 issuer: Issuer.uri(signer.did),
);
Implemented types
Implementers

Constructors

VcDataModelV1({required JsonLdContext context, Uri? id, required List<CredentialSubject> credentialSubject, required Issuer issuer, required Set<String> type, required DateTime issuanceDate, List<CredentialSchema>? credentialSchema, DateTime? expirationDate, Holder? holder, List<EmbeddedProof>? proof, CredentialStatusV1? credentialStatus, List<RefreshServiceV1>? refreshService, List<TermsOfUse>? termsOfUse, List<Evidence>? evidence})
Creates a VcDataModelV1 instance.
VcDataModelV1.clone(VcDataModelV1 input)
Creates a new VcDataModelV1 instance as a deep copy of the provided input.
VcDataModelV1.fromJson(dynamic input)
Creates a VcDataModelV1 from JSON input.
factory
VcDataModelV1.fromMutable(MutableVcDataModelV1 data)
Factory constructor to create a VcDataModelV1 instance from a mutable MutableVcDataModelV1
factory

Properties

context JsonLdContext
The JSON-LD context for this presentation.
final
credentialSchema UnmodifiableListView<CredentialSchema>
The schema(s) used to define the structure of the credential.
final
credentialStatus CredentialStatusV1?
Credential status object to validate credentials revocation
final
credentialSubject UnmodifiableListView<CredentialSubject>
The subject data contained in this credential.
final
evidence UnmodifiableListView<Evidence>
Evidence supporting the claims in the credential.
final
expirationDate DateTime?
The date and time the credential expires.
final
hashCode int
The hash code for this object.
no setterinherited
holder Holder?
The identifier of the holder presenting the credentials.
final
id Uri?
The optional identifier for the Verifiable Credential.
final
issuanceDate DateTime
The date and time the credential was issued.
final
issuer Issuer
The schema(s) used to define the structure of the credential.
final
proof UnmodifiableListView<EmbeddedProof>
The cryptographic proof(s) created by the issuer.
final
refreshService UnmodifiableListView<RefreshServiceV1>
service(s) for how the credential can be refreshed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
termsOfUse UnmodifiableListView<TermsOfUse>
The terms of use for the Verifiable Credential.
final
type UnmodifiableSetView<String>
The type definitions for this presentation.
final
validFrom DateTime
The date and time the credential was issued.
no setteroverride
validUntil DateTime?
The date and time the credential expires.
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the VcDataModelV1 instance to a JSON representation.
override
toString() String
A string representation of this object.
inherited
validate() bool
Validates the essential Verifiable Credential properties (context, type, credentialSubject).

Operators

operator ==(Object other) bool
The equality operator.
inherited