VerifiableCredential constructor

VerifiableCredential({
  1. required List context,
  2. required List<String> type,
  3. required dynamic issuer,
  4. required dynamic credentialSubject,
  5. String? id,
  6. required DateTime issuanceDate,
  7. CredentialStatus? status,
  8. CredentialStatus? credentialSchema,
  9. DateTime? expirationDate,
  10. LinkedDataProof? proof,
})

Implementation

VerifiableCredential(
    {required this.context,
    required this.type,
    required this.issuer,
    required this.credentialSubject,
    this.id,
    required this.issuanceDate,
    this.status,
    this.credentialSchema,
    this.expirationDate,
    this.proof}) {
  if (context.first != credentialsV1Iri) {
    throw FormatException(
        'The context-Array must start with $credentialsV1Iri');
  }
  for (var iri in context) {
    if (iri is String) {
      if (!isUri(iri)) {
        throw FormatException('$iri is no valid iri.');
      }
    }
  }
}