OpenID4VCIBackendUtil

Utilities helpful for implementing OpenID4VCIBackend.

In production environments, these are typically run on the server as private keys used for signing should be kept secret and cannot be embedded in a client app.

For test environments, these can be invoked directly in the client app for simplicity.

Functions

Link copied to clipboard
suspend fun createJwtClientAssertion(signingKey: AsymmetricKey, clientId: String, authorizationServerIdentifier: String): String

Generates Client Assertion JWT to authenticate a client to an OpenID authorization server using a client's private key.

Link copied to clipboard
suspend fun createJwtKeyAttestation(signingKey: AsymmetricKey, attestationIssuer: String, keysToAttest: List<KeyAttestation>, challenge: String, userAuthentication: List<String>? = null, keyStorage: List<String>? = null): String

Generates JWT implementing OpenID4VCI Appendix D.1. "Key Attestation in JWT format".

Link copied to clipboard
suspend fun createWalletAttestation(signingKey: AsymmetricKey, clientId: String, attestationIssuer: String, attestedKey: EcPublicKey, nonce: String?, walletName: String?, walletLink: String?): String

Generates JWT implementing OpenID4VCI Appendix E. Wallet Attestations in JWT format (a.k.a Client Attestation).