encrypt Decrypt
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.
For CryptoKeyType.MK_SK, baSessionKey must be provided; the operation uses this session key.
For CryptoKeyType.DUKPT_TDES, baSessionKey is ignored;
baInitializationVector is required for CBC mode, ignored for ECB.
The caller must provide a sufficiently-sized baOutput array for the result (same size as baData).
Parameters
Specifies encryption or decryption (CryptoEncryptionMode).
Specifies the cipher block mode (CryptoCipherMethod).
Selects the key type to use (CryptoKeyType).
The intended use of the key (CryptoKeyPurpose).
Index of the DUKPT key or MK/SK group (0–99).
Optional session key (used only for MK/SK).
Initialization vector for CBC mode, or null for ECB.
Input data to encrypt/decrypt.
Output array to store the operation result; must be large enough to hold the result.
Throws
If the cryptographic operation fails (e.g., invalid parameters, missing key, secure element error).