OID4VCIClaimVerifiableCredentialService class

Represents a service for claiming credentials by interacting with a Claim Verifiable Credential Issuance (OID4VCI) API.

The OID4VCIClaimVerifiableCredentialService handles loading credential offers from a given URI, retrieving necessary issuer metadata, and ultimately claiming a verifiable credential. It leverages a OID4VCIClaimVerifiableCredentialApiServiceInterface to perform API calls and a ConsumerAuthProvider to manage authentication tokens.

Example:

final service = OID4VCIClaimVerifiableCredentialService(
  seed: someUint8ListSeed,
);

// Load the credential offer context
final claimContext = await service.loadCredentialOffer(
  Uri.parse('https://example.com?credentialOfferUri=https://issuer.example.com/offers/123'),
);

// Claim the credential using the loaded context
final credential = await service.claimCredential(
  claimContext: claimContext,
  txCode: 'optionalTxCode',
);
Log.debug('Credential details: $credential', component: 'YourComponent');

Constructors

OID4VCIClaimVerifiableCredentialService({required DidSigner didSigner, Dio? client, OID4VCIClaimVerifiableCredentialApiServiceInterface? claimVerifiableCredentialApiService, ConsumerAuthProvider? consumerAuthProvider, Logger? logger})
Creates a OID4VCIClaimVerifiableCredentialService instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

claimCredential({required OID4VCIClaimContext claimContext, String? txCode}) Future<VerifiableCredential>
Claims a credential using the provided claimContext and optional txCode.
loadCredentialOffer(Uri uri) Future<OID4VCIClaimContext>
Loads a credential offer from the given uri and returns a OID4VCIClaimContext containing both the credential offer and the issuer metadata.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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