21#include "IllegalArgumentException.h"
28using namespace keyple::core::util;
29using namespace keyple::core::util::cpp;
30using namespace keyple::core::util::cpp::exception;
34const std::map<const int, const std::shared_ptr<StatusProperties>>
35 CmdSamGetChallenge::STATUS_TABLE = initStatusTable();
38 const uint8_t expectedResponseLength)
41 if (expectedResponseLength != 0x04 && expectedResponseLength != 0x08) {
42 throw IllegalArgumentException(
"Bad challenge length! Expected 4 or 8, got " +
43 std::to_string(expectedResponseLength));
47 const uint8_t p1 = 0x00;
48 const uint8_t p2 = 0x00;
51 std::make_shared<ApduRequestAdapter>(
60const std::map<const int, const std::shared_ptr<StatusProperties>>
61 CmdSamGetChallenge::initStatusTable()
63 std::map<const int, const std::shared_ptr<StatusProperties>> m =
67 std::make_shared<StatusProperties>(
"Incorrect Lc.",
73const std::map<const int, const std::shared_ptr<StatusProperties>>&
virtual const std::shared_ptr< ApduResponseApi > getApduResponse() const final
virtual bool isSuccessful() const final
virtual void setApduRequest(const std::shared_ptr< ApduRequestAdapter > apduRequest) final
static const std::map< const int, const std::shared_ptr< StatusProperties > > STATUS_TABLE
uint8_t getInstructionByte() const override
static const CalypsoSamCommand GET_CHALLENGE
CmdSamGetChallenge(const CalypsoSam::ProductType productType, const uint8_t expectedResponseLength)
const std::map< const int, const std::shared_ptr< StatusProperties > > & getStatusTable() const override
const std::vector< uint8_t > getChallenge() const
static uint8_t getClassByte(const ProductType productType)
CalypsoSam::ProductType ProductType