14#include "keyple/card/calypso/crypto/legacysam/CommandDigestClose.hpp"
20#include "keyple/card/calypso/crypto/legacysam/AccessForbiddenException.hpp"
21#include "keyple/core/util/ApduUtil.hpp"
29using keyple::core::util::ApduUtil;
31const std::map<int, const std::shared_ptr<StatusProperties>>
32 CommandDigestClose::STATUS_TABLE = [] {
33 std::map<int, const std::shared_ptr<StatusProperties>> m(
34 Command::STATUS_TABLE);
38 std::make_shared<StatusProperties>(
39 "Preconditions not satisfied",
40 typeid(AccessForbiddenException))}});
44CommandDigestClose::CommandDigestClose(
45 std::shared_ptr<CommandContextDto> context,
int expectedResponseLength)
46: Command(CommandRef::DIGEST_CLOSE, expectedResponseLength, context)
49 std::make_shared<ApduRequestAdapter>(ApduUtil::build(
50 context->getTargetSam()->getClassByte(),
51 getCommandRef().getInstructionByte(),
54 static_cast<uint8_t
>(expectedResponseLength))));
56const std::vector<std::uint8_t>&
57CommandDigestClose::getMac()
const
63CommandDigestClose::finalizeRequest()
69CommandDigestClose::isControlSamRequiredToFinalizeRequest()
const
75CommandDigestClose::parseResponse(std::shared_ptr<ApduResponseApi> apduResponse)
77 setResponseAndCheckStatus(apduResponse);
78 mMac = apduResponse->getDataOut();
81const std::map<int, const std::shared_ptr<StatusProperties>>&
82CommandDigestClose::getStatusTable()
const