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
- Initialize the SDK.
- Claim and manage credentials.
- Present a credential in-person (proximity verification workflow).
- Present a credential online (remote verification workflow).
Components
Classes
The following classes are the core components of all SDK interactions:
MobileCredentialHolder
: This class serves as the entry point for any interaction with the SDK.ProximityPresentationSession
: This class represents a proximity presentation session with a verifier using device retrieval, as per ISO/IEC 18013-5:2021.OnlinePresentationSession
: This class represents an online presentation session with a verifier, as per ISO/IEC 18013-7:2024 and OID4VP.
Methods
General
initialise
: Initializes theMobileCredentialHolder
class.
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 ofMobileCredentialMetadata
. 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 ofMobileCredential
. 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 theaddCredential
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 unlikeMobileCredential
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.