capture PIN
Securely captures a PIN from the user, encrypts it using a specified key, and writes the resulting PIN block into baPinBlock.
This function manages user PIN entry under secure conditions, including length restrictions, audible feedback, and timeouts.
Be aware that if the DUKPT encryption method was selected, for security purposes, this method MUST advance the KSN right after the encryption the pin block.
Parameters
The type of key to use for encryption (CryptoKeyType).
The index of the key to use (0–99).
Optional session key (required for MK/SK; ignored for DUKPT).
Primary Account Number (PAN), used for PIN block formatting.
Maximum allowed PIN length (inclusive).
Minimum allowed PIN length (inclusive).
Enables keypad audio feedback if true.
Timeout (in seconds) for entry of each PIN digit.
Overall timeout (in seconds) for the entire PIN entry process.
If true, allows PIN bypass; otherwise, PIN entry is mandatory.
Message to display to the user during PIN entry.
Output array to receive the encrypted PIN block; must be sized according to expected block length.
Throws
If PIN entry or encryption fails (e.g., timeouts, invalid parameters, missing key).