getKSN

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

The KSN uniquely identifies the transaction state for DUKPT keys, allowing tracking and verification of key usage.

Return

The current KSN value as a byte array (10 bytes) or an empty Byte Array.

Parameters

eKeyPurpose

The DUKPT key purpose (CryptoKeyPurpose).

iKeyIndex

The index of the DUKPT key (0–99).