VerificationUtil

Utility functions for requesting and verifying credentials.

Functions

Link copied to clipboard
suspend fun decryptDcResponse(response: JsonObject, nonce: ByteString, origin: String, responseEncryptionKey: AsymmetricKey?): DcResponse

Decrypts a W3C Digital Credentials response.

Link copied to clipboard
suspend fun generateDcRequestDcql(exchangeProtocols: List<String>, dcql: JsonObject, nonce: ByteString, origin: String, clientId: String?, responseEncryptionKey: EcPublicKey?, readerAuthenticationKey: AsymmetricKey.X509Compatible?, jsonTransactionData: List<String> = emptyList(), docRequestOtherInfo: Map<String, Map<String, DataItem>> = emptyMap(), state: String? = null): JsonObject

Utility function to generate a W3C Digital Credentials API request for requesting credentials.

Link copied to clipboard
suspend fun generateDcRequestMdoc(exchangeProtocols: List<String>, docType: String, claims: List<MdocRequestedClaim>, nonce: ByteString, origin: String, clientId: String?, responseEncryptionKey: EcPublicKey?, readerAuthenticationKey: AsymmetricKey.X509Compatible?, zkSystemSpecs: List<ZkSystemSpec>, jsonTransactionData: List<String> = emptyList(), docRequestOtherInfo: Map<String, DataItem> = emptyMap()): JsonObject

Utility function to generate a W3C Digital Credentials API request for requesting a single ISO mdoc credential.

Link copied to clipboard
suspend fun generateDcRequestSdJwt(exchangeProtocols: List<String>, vct: List<String>, claims: List<JsonRequestedClaim>, nonce: ByteString, origin: String, clientId: String?, responseEncryptionKey: EcPublicKey?, readerAuthenticationKey: AsymmetricKey.X509Compatible?, jsonTransactionData: List<String> = emptyList()): JsonObject

Utility function to generate a W3C Digital Credentials API request for requesting a single SD-JWT credential.

Link copied to clipboard
suspend fun generateVerificationSessionForDcql(requestTypes: Collection<VerificationSession.RequestType>, dcql: String, readerAuthenticationKey: AsymmetricKey.X509Compatible?, origin: String? = null, clientId: String? = null, transactionData: List<String>? = null, nonce: ByteString = ByteString(Random.nextBytes(18)), encryptResponse: Boolean = true, responseUri: String? = null, documentTypeRepository: DocumentTypeRepository? = null, deviceEngagement: ByteString? = null, handover: DataItem? = null, eReaderKey: EcPrivateKey? = null, state: String? = null): VerificationSession

Makes a request for credential presentation using W3C Digital Credentials API

Link copied to clipboard
suspend fun verifyMdocDeviceResponse(now: Instant, deviceResponse: DataItem, sessionTranscript: DataItem, eReaderKey: AsymmetricKey?, documentTypeRepository: DocumentTypeRepository?, zkSystemRepository: ZkSystemRepository?, request: DeviceRequest?): List<VerifiedPresentation>

Generates VerifiedPresentation from an ISO 18013-5 response.

Link copied to clipboard
suspend fun verifyOpenID4VPResponse(now: Instant, vpToken: JsonObject, sessionTranscript: DataItem?, nonce: String, documentTypeRepository: DocumentTypeRepository?, zkSystemRepository: ZkSystemRepository?, transactionDataMap: Map<String, List<TransactionDataJson>> = emptyMap(), queryData: Map<String, QueryData>): List<VerifiedPresentation>

Generates VerifiedPresentation from an OpenID4VP response.

Link copied to clipboard
suspend fun verifySdJwtPresentation(compactSerialization: String, nonce: String, documentTypeRepository: DocumentTypeRepository?, transactionData: List<TransactionData>, identifier: String? = null): VerifiedPresentation

Generates VerifiedPresentation from an SD-JWT / SD-JWT+KB presentation.