TransactionType

abstract class TransactionType<PayloadT : Any>(val displayName: String, val identifier: String, val kbJwtResponseClaimName: String = identifier, val mdocRequestInfoKeyName: String = identifier, val mdocResponseNamespace: String = identifier)

An object that represents a particular transaction data type.

All transaction types that are expected to be processed or rejected must be registered in a DocumentTypeRepository object. In OpenID4VP unregistered transaction types cause the whole request to be rejected. In ISO/IEC 18013-5:2021, unknown transaction types are not processed, which may or may not fail at verification time.

Parameters

displayName

human-readable transaction name

identifier

unique transaction type identifier, corresponds to the type property in transaction data in OpenID4VP; all TransactionType objects must have distinct identifiers.

kbJwtResponseClaimName

if transaction processing results in any data, it will be inserted in key binding JWT using this claim name; all TransactionType objects must have distinct values.

mdocRequestInfoKeyName

key to use in requestInfo map in ISO/IEC 18013-5:2021 document request to represent this transaction data; all TransactionType objects must have distinct values.

mdocResponseNamespace

namespace to use in deviceSigned namespace map in ISO/IEC 18013-5:2021 response to represent transaction hash and transaction processing results; all TransactionType objects must have distinct values.

Constructors

Link copied to clipboard
constructor(displayName: String, identifier: String, kbJwtResponseClaimName: String = identifier, mdocRequestInfoKeyName: String = identifier, mdocResponseNamespace: String = identifier)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open suspend fun applyCbor(transactionData: TransactionData<PayloadT>, credential: Credential): Map<String, DataItem>?

Applies transaction in the context of ISO/IEC 18013-5:2021 presentment.

Link copied to clipboard
open suspend fun applyJson(transactionData: TransactionData<PayloadT>, credential: Credential): JsonElement?

Applies transaction in the context of OpenID4VP presentment.

Link copied to clipboard
abstract suspend fun isApplicable(transactionData: TransactionData<PayloadT>, credential: Credential): Boolean

Determines if this transaction is applicable to the given credential.

Link copied to clipboard
abstract fun parseCbor(serialized: ByteString): TransactionData<PayloadT>

Parses transaction data serialized for use in ISO/IEC 18013 protocols.

Link copied to clipboard
abstract fun parseJson(serialized: ByteString): TransactionData<PayloadT>

Parses transaction data serialized for use in OpenID4VP protocol.

Link copied to clipboard
abstract fun serializeCbor(payload: PayloadT, hashAlgorithms: List<Algorithm>? = null): ByteString

Serializes transaction data for use in ISO/IEC 18013 protocols.

Link copied to clipboard
abstract fun serializeJson(payload: PayloadT, credentialIds: List<String>, hashAlgorithms: List<Algorithm>? = null): String

Serializes transaction data for use in OpenID4VP protocol.