Openid4VpVerifierModel

class Openid4VpVerifierModel(val clientId: String, val nonce: ByteString = ByteString(Random.nextBytes(15)), val ephemeralPrivateKey: EcPrivateKey = Crypto.createEcPrivateKey(EcCurve.P256), val requestedFormats: MutableMap<String, String> = mutableMapOf())

Object that holds data necessary to verify Openid4VP credential presentation.

This class is designed to work in the environment where its state may need to be serialized between the time that the presentation request is generated (see makeRequest) and the device response is verified (see processResponse), as is typically the case on the server.

This class creates requests for and parses only encrypted presentations (using either "dc_api.jwt" or "direst_post.jwt" response mode) and it requires compliance with draft 28 of the Openid4VP spec.

Constructors

Link copied to clipboard
constructor(clientId: String, nonce: ByteString = ByteString(Random.nextBytes(15)), ephemeralPrivateKey: EcPrivateKey = Crypto.createEcPrivateKey(EcCurve.P256), requestedFormats: MutableMap<String, String> = mutableMapOf())

Types

Link copied to clipboard
sealed class Presentation
Link copied to clipboard
data class ReaderIdentity(val privateKey: EcPrivateKey, val certificateChain: X509CertChain)
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val nonce: ByteString
Link copied to clipboard

Functions

Link copied to clipboard
fun makeRequest(state: String, responseMode: String, requests: Map<String, DocumentCannedRequest>, readerIdentity: Openid4VpVerifierModel.ReaderIdentity, expectedOrigins: List<String> = listOf(), responseUri: String? = null): String

Creates an Openid4VP presentation request for credentials (typically just one) in requests parameter.

Link copied to clipboard

Parses and validates credential presentation for the request that was previously created using makeRequest.