incrementKSN

abstract fun incrementKSN(eKeyPurpose: CryptoKeyPurpose, iKeyIndex: Int): NexusRet

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

In DUKPT schemes, incrementing the KSN ensures unique transaction keys for each operation. This method advances the KSN’s transaction counter as required by DUKPT.

Parameters

eKeyPurpose

The DUKPT key purpose (CryptoKeyPurpose).

iKeyIndex

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

Throws

If the key is not a valid DUKPT key, does not exist, or the KSN cannot be incremented.