mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
ExportKey and ImportKey take an As2805KeyCryptogram: a TDES key leaves and comes back under a TR31_K0 TDES key encryption key, bound to one of the four AS2805 variants. The cryptogram carries a tag over the whole of it, made under a key derived from the wrapping key and checked before anything is decrypted, and the key's ANSI X9.24 check value, which the import compares. A wrapping key that is not K0, not TDES or weaker than the key is refused, as is a variant that does not match the key's purpose. Bytes holds the concat, PKCS#7 padding and isHex the payment cryptography classes kept copies of, and the SDK and CLI compatibility tests cover the round trip and its refusals.