14#include "keyple/card/calypso/crypto/legacysam/CommandRef.hpp"
23const CommandRef CommandRef::SELECT_DIVERSIFIER(
"Select Diversifier", 0x14);
24const CommandRef CommandRef::GET_CHALLENGE(
"Get Challenge", 0x84);
25const CommandRef CommandRef::DIGEST_INIT(
"Digest Init", 0x8A);
26const CommandRef CommandRef::DIGEST_UPDATE(
"Digest Update", 0x8C);
28 CommandRef::DIGEST_UPDATE_MULTIPLE(
"Digest Update Multiple", 0x8C);
29const CommandRef CommandRef::DIGEST_CLOSE(
"Digest Close", 0x8E);
30const CommandRef CommandRef::DIGEST_AUTHENTICATE(
"Digest Authenticate", 0x82);
31const CommandRef CommandRef::DIGEST_INTERNAL_AUTHENTICATE(
32 "Digest Internal Authenticate", 0x88);
33const CommandRef CommandRef::GIVE_RANDOM(
"Give Random", 0x86);
34const CommandRef CommandRef::CARD_GENERATE_KEY(
"Card Generate Key", 0x12);
35const CommandRef CommandRef::CARD_CIPHER_PIN(
"Card Cipher PIN", 0x12);
36const CommandRef CommandRef::UNLOCK(
"Unlock", 0x20);
37const CommandRef CommandRef::WRITE_KEY(
"Write Key", 0x1A);
38const CommandRef CommandRef::READ_KEY_PARAMETERS(
"Read Key Parameters", 0xBC);
39const CommandRef CommandRef::READ_EVENT_COUNTER(
"Read Event Counter", 0xBE);
40const CommandRef CommandRef::READ_CEILINGS(
"Read Ceilings", 0xBE);
41const CommandRef CommandRef::READ_PARAMETERS(
"Read Parameters", 0xBE);
42const CommandRef CommandRef::SV_CHECK(
"SV Check", 0x58);
43const CommandRef CommandRef::SV_PREPARE_DEBIT(
"SV Prepare Debit", 0x54);
44const CommandRef CommandRef::SV_PREPARE_LOAD(
"SV Prepare Load", 0x56);
45const CommandRef CommandRef::SV_PREPARE_UNDEBIT(
"SV Prepare Undebit", 0x5C);
46const CommandRef CommandRef::DATA_CIPHER(
"Data Cipher", 0x1C);
48 CommandRef::PSO_COMPUTE_SIGNATURE(
"PSO Compute Signature", 0x2A);
49const CommandRef CommandRef::PSO_VERIFY_SIGNATURE(
"PSO Verify Signature", 0x2A);
50const CommandRef CommandRef::SAM_DATA_CIPHER(
"SAM Data Cipher", 0x16);
51const CommandRef CommandRef::SAM_GENERATE_KEY(
"SAM Generate Key", 0x16);
52const CommandRef CommandRef::WRITE_CEILINGS(
"Write Ceilings", 0xD8);
53const CommandRef CommandRef::WRITE_PARAMETERS(
"Write Parameters", 0xD8);
54const CommandRef CommandRef::GET_DATA(
"Get Data", 0xCA);
56 CommandRef::PSO_COMPUTE_CERTIFICATE(
"PSO Compute Certificate", 0x2A);
57const CommandRef CommandRef::CARD_GENERATE_ASYMMETRIC_KEY_PAIR(
58 "Card Generate Asymmetric Key Pair", 0x46);
60CommandRef::CommandRef(
const std::string& name, std::uint8_t instructionByte)
62, mInstructionByte(instructionByte)
67CommandRef::getName()
const
73CommandRef::getInstructionByte()
const
75 return mInstructionByte;
79CommandRef::operator==(
const CommandRef& other)
const
81 return mName == other.mName && mInstructionByte == other.mInstructionByte;
85CommandRef::operator!=(
const CommandRef& other)
const
87 return !(*
this == other);