Update card PIN
Cards
Update card PIN
Updates the card PIN.
PIN Block Format (ISO 9564-1 Format 2): The PIN must be formatted as a 16-character PIN block before encryption:
- Byte 0: Control field (
2indicates Format 2) - Byte 1: PIN length in hexadecimal (4-12)
- Bytes 2-(1+N): The actual PIN digits
- Remaining bytes: Padding (
F)
Example:
A 4-digit PIN “5678” would be encoded as: 245678FFFFFFFFFF
Formatting the PIN block:
const pinBlock = `2${pinLength.toString(16)}${pin}${'F'.repeat(14 - pinLength)}`;
Encryption:
- Generate a random AES-128 key
- Encrypt the PIN block using AES-128-GCM with the random key
- RSA-encrypt the AES key using the server’s public key
- Send the RSA-encrypted key as
encryptedKeyand the AES-encrypted PIN block asencryptedPin
Validation:
- PIN must be 4-12 digits
- Weak PINs (repeating like 1111, sequential like 1234) are rejected
POST
Update card PIN
Authorizations
Cognito JWT token for regular user authentication
Path Parameters
The id of the card whose pin is being updated
Minimum string length:
1Body
Response
Response for status 200