VcDataModelV2 class
Represents a Verifiable Credential (VC) according to the W3C VC Data Model v2.
A Verifiable Credential (VC) is a digitally signed statement, issued by issuer
This class supports JSON serialization and deserialization for interoperability. Example:
VcDataModelV2(
context: [
'https://www.w3.org/ns/credentials/v2',
'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'
})
],
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
-
VcDataModelV2({required JsonLdContext context, Uri? id, required List<
CredentialSubject> credentialSubject, required Issuer issuer, required Set<String> type, DateTime? validFrom, DateTime? validUntil, List<CredentialSchema> ? credentialSchema, List<EmbeddedProof> ? proof, List<CredentialStatusV2> ? credentialStatus, List<RefreshServiceV2> ? refreshService, List<TermsOfUse> ? termsOfUse, List<Evidence> ? evidence}) - Creates a VcDataModelV2 instance.
- VcDataModelV2.clone(VcDataModelV2 input)
-
Creates a new VcDataModelV2 instance as a deep copy of the provided
input. - VcDataModelV2.fromJson(dynamic input)
-
Creates a VcDataModelV2 from JSON input.
factory
- VcDataModelV2.fromMutable(MutableVcDataModelV2 data)
-
Factory constructor to create a VcDataModelV2 instance from a mutable MutableVcDataModelV2
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
→ UnmodifiableListView<
CredentialStatusV2> -
Credential status object to validate credentials revocation or suspension
final
-
credentialSubject
→ UnmodifiableListView<
CredentialSubject> -
The subject data contained in this credential.
final
-
evidence
→ UnmodifiableListView<
Evidence> -
Evidence supporting the claims in the credential.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → Uri?
-
The optional identifier for the Verifiable Credential.
final
- issuer → Issuer
-
The entity that issued this credential.
final
-
proof
→ UnmodifiableListView<
EmbeddedProof> -
The cryptographic proof(s) created by the issuer.
final
-
refreshService
→ UnmodifiableListView<
RefreshServiceV2> -
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 at which the credential becomes effective.
final
- validUntil → DateTime?
-
The date and time at which the credential becomes invalid.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts the VcDataModelV2 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