Skip to content

GenerateMacEmvPinChange

Source: src/AWS/PaymentCryptography/GenerateMacEmvPinChange.ts

Runtime binding for payment-cryptography:GenerateMacEmvPinChange — generates the issuer-script MAC (and re-encrypted PIN block) for an EMV PIN change command. Binds three Keys: the new PIN encryption key (PEK) the changed PIN is encrypted under, and the secure-messaging integrity and confidentiality issuer master keys. Provide GenerateMacEmvPinChangeHttp on the Function to satisfy this service.

// init
const generatePinChangeMac = yield* PaymentCryptography.GenerateMacEmvPinChange(
newPinPek,
secureMessagingIntegrityKey,
secureMessagingConfidentialityKey,
);
// runtime
const result = yield* generatePinChangeMac({
NewEncryptedPinBlock: newEncryptedPinBlock,
PinBlockFormat: "ISO_FORMAT_0",
MessageData: messageDataHex,
DerivationMethodAttributes: { Emv2000: { ... } },
});