21#include "IllegalArgumentException.h"
27using namespace keyple::core::util;
28using namespace keyple::core::util::cpp::exception;
32const std::map<const int, const std::shared_ptr<StatusProperties>>
33 CmdSamGiveRandom::STATUS_TABLE = initStatusTable();
36 const std::vector<uint8_t>& random)
40 const uint8_t p1 = 0x00;
41 const uint8_t p2 = 0x00;
43 if (random.empty() || random.size() != 8) {
45 throw IllegalArgumentException(
"Random value should be an 8 bytes long");
49 std::make_shared<ApduRequestAdapter>(
53const std::map<const int, const std::shared_ptr<StatusProperties>>
54 CmdSamGiveRandom::initStatusTable()
56 std::map<const int, const std::shared_ptr<StatusProperties>> m =
60 std::make_shared<StatusProperties>(
"Incorrect Lc.",
66const std::map<const int, const std::shared_ptr<StatusProperties>>&
virtual void setApduRequest(const std::shared_ptr< ApduRequestAdapter > apduRequest) final
static const std::map< const int, const std::shared_ptr< StatusProperties > > STATUS_TABLE
static const CalypsoSamCommand GIVE_RANDOM
uint8_t getInstructionByte() const override
CmdSamGiveRandom(const std::shared_ptr< CalypsoSamAdapter > calypsoSam, const std::vector< uint8_t > &random)
const std::map< const int, const std::shared_ptr< StatusProperties > > & getStatusTable() const override
static uint8_t getClassByte(const ProductType productType)