CryptoPort

interface CryptoPort

Defines a contract for cryptographic operations (TDES encryption/decryption, PIN capture, key management) using either DUKPT or MK/SK schemes within a secure element.

Functions

Link copied to clipboard
abstract fun capturePIN(tInputCapturePin: TypeInputCapturePin): TypeOutputCapturePin

Securely captures a PIN from the user, encrypts it using a specified key, and writes the resulting PIN block into baPinBlock.

Link copied to clipboard

Encrypts or decrypts data using the Triple DES (TDES) algorithm with either a DUKPT key or a session key derived from a master key (MK/SK). The operation mode, cipher mode, key type, and other parameters determine the exact cryptographic context.

Link copied to clipboard
abstract fun getKSN(eKeyPurpose: CryptoKeyPurpose, iKeyIndex: Int): TypeOutputGetKSN

Retrieves the current Key Serial Number (KSN) for a DUKPT key. If the required key does not exists it must not throw a exception, instead it must return an empty Byte Array

Link copied to clipboard
abstract fun incrementKSN(eKeyPurpose: CryptoKeyPurpose, iKeyIndex: Int): NexusRet

Increments the Key Serial Number (KSN) for a DUKPT key identified by eKeyPurpose and iKeyIndex.

Link copied to clipboard
abstract fun isKeyPresent(eKeyType: CryptoKeyType, tKeyPurpose: CryptoKeyPurpose, iKeyIndex: Int): NexusRet

Checks if a cryptographic key of a specific type, purpose, and index is present in the secure element.