Usage

This section provides an overview of how to use the key SDK components and capabilities.

This is not an inclusive list of the SDK’s components capabilities. These are available in the SDK’s reference documentation.

Capabilities

Components

Classes

The following classes are the core components of all SDK interactions:

Methods

General

Refer to the Initialize SDK section for more information and usage examples.

Credential management

  • DiscoveredCredentialOffer: Retrieves credential offer details from an issuer.
  • retrieveCredentials: Retrieves credentials from an issuer based on an existing credential offer.
  • addCredential : Adds a new credential to the application storage.
  • getCredentials : Retrieves the metadata of all credentials in the application storage and returns them as instances of MobileCredentialMetadata. This structure does not contain any claim values or the credential’s verification status.
  • getCredential : Retrieves a specific credential from the application storage as an instance of MobileCredential. This structure includes claim values as well as the credential’s verification status.

Refer to the Claim a credential section for more information and usage examples.

Certificate management

  • addTrustedIssuerCertificates : Use this method to add an issuer’s certificate to the application storage. Issuer certificates are used when new credentials are added by the addCredential method. Credentials can only be stored if their issuer’s valid certificate exists in the application storage. Prior to adding a certificate, the SDK validates it as per the IACA profile defined in ISO/IEC 18013-5:2021.
  • addTrustedVerifierCertificates : Use this method to add a verifier’s certificate to the application storage. Verifier certificates are used to verify the authorization request object as part of an OID4VP workflow, as per Annex B of ISO/IEC 18013-7:2024.

Refer to the Claim a credential section for more information and usage examples.

Structures

  • MobileCredential : Represents an existing credential, including all its claims and verification result.

  • MobileCredentialMetadata : Represents an existing credential, but unlike MobileCredential it only includes the credential metadata, excluding its claims and verification result.

  • MobileCredentialRequest : Represents a request for presenting credentials. This structures defines:

    • docType : The requested credential type.
    • namespaces : The specific namespaces and claims within them that are requested for verification.

    By comparing this structure with stored credentials, the SDK can return stored credentials that match the request and display them to the user.