TransactionType

abstract class TransactionType(val displayName: String, val identifier: String, attributes: List<MdocDataElement>, 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.

attributes

describes attributes that this transaction type can/must contain

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, attributes: List<MdocDataElement>, kbJwtResponseClaimName: String = identifier, mdocRequestInfoKeyName: String = identifier, mdocResponseNamespace: String = identifier)

Properties

Link copied to clipboard

Maps transaction data property name to its definition

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, credential: Credential): Map<String, DataItem>?

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

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

Applies transaction in the context of OpenID4VP presentment.

Link copied to clipboard

Builds CannedTransactionData for this request type.

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

Determines if this transaction is applicable to the given credential.