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) {
44 throw IllegalArgumentException(
"Random value should be an 8 bytes long");
48 std::make_shared<ApduRequestAdapter>(
52const std::map<const int, const std::shared_ptr<StatusProperties>>
53 CmdSamGiveRandom::initStatusTable()
55 std::map<const int, const std::shared_ptr<StatusProperties>> m =
59 std::make_shared<StatusProperties>(
"Incorrect Lc.",
65const 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
const std::map< const int, const std::shared_ptr< StatusProperties > > & getStatusTable() const override
CmdSamGiveRandom(const CalypsoSam::ProductType productType, const std::vector< uint8_t > &random)
static uint8_t getClassByte(const ProductType productType)
CalypsoSam::ProductType ProductType