Keyple Card Calypso C++ Library - 3.2.2
Component of the Keyple C++ middleware
CardCommandRef.cpp
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
3 * *
4 * See the NOTICE file(s) distributed with this work for additional *
5 * information regarding copyright ownership. *
6 * *
7 * This program and the accompanying materials are made available under the *
8 * terms of the Eclipse Public License 2.0 which is available at *
9 * http://www.eclipse.org/legal/epl-2.0 *
10 * *
11 * SPDX-License-Identifier: EPL-2.0 *
12 ******************************************************************************/
13
14#include "keyple/card/calypso/CardCommandRef.hpp"
15
16namespace keyple {
17namespace card {
18namespace calypso {
19
20const CardCommandRef CardCommandRef::NONE("None", 0x00);
21
22const CardCommandRef CardCommandRef::GET_DATA("Get Data", 0xCA);
23const CardCommandRef CardCommandRef::PUT_DATA("Put Data", 0xDA);
24const CardCommandRef CardCommandRef::OPEN_SECURE_SESSION("Open Secure Session", 0x8A);
25const CardCommandRef CardCommandRef::CLOSE_SECURE_SESSION("Close Secure Session", 0x8E);
26const CardCommandRef CardCommandRef::MANAGE_SECURE_SESSION("Manage Secure Session", 0x82);
27const CardCommandRef CardCommandRef::RATIFICATION("Ratification", 0xB2);
28const CardCommandRef CardCommandRef::READ_RECORDS("Read Records", 0xB2);
29const CardCommandRef CardCommandRef::UPDATE_RECORD("Update Record", 0xDC);
30const CardCommandRef CardCommandRef::WRITE_RECORD("Write Record", 0xD2);
31const CardCommandRef CardCommandRef::APPEND_RECORD("Append Record", 0xE2);
32const CardCommandRef CardCommandRef::READ_BINARY("Read Binary", 0xB0);
33const CardCommandRef CardCommandRef::UPDATE_BINARY("Update Binary", 0xD6);
34const CardCommandRef CardCommandRef::WRITE_BINARY("Write Binary", 0xD0);
35const CardCommandRef CardCommandRef::SEARCH_RECORD_MULTIPLE("Search Record Multiple", 0xA2);
36const CardCommandRef CardCommandRef::READ_RECORD_MULTIPLE("Read Record Multiple", 0xB3);
37const CardCommandRef CardCommandRef::GET_CHALLENGE("Get Challenge", 0x84);
38const CardCommandRef CardCommandRef::INCREASE("Increase", 0x32);
39const CardCommandRef CardCommandRef::DECREASE("Decrease", 0x30);
40const CardCommandRef CardCommandRef::INCREASE_MULTIPLE("Increase Multiple", 0x3A);
41const CardCommandRef CardCommandRef::DECREASE_MULTIPLE("Decrease Multiple", 0x38);
42const CardCommandRef CardCommandRef::SELECT_FILE("Select File", 0xA4);
43const CardCommandRef CardCommandRef::CHANGE_KEY("Change Key", 0xD8);
44const CardCommandRef CardCommandRef::CHANGE_PIN("Change PIN", 0xD8);
45const CardCommandRef CardCommandRef::VERIFY_PIN("Verify PIN", 0x20);
46const CardCommandRef CardCommandRef::SV_GET("SV Get", 0x7C);
47const CardCommandRef CardCommandRef::SV_DEBIT("SV Debit", 0xBA);
48const CardCommandRef CardCommandRef::SV_RELOAD("SV Reload", 0xB8);
49const CardCommandRef CardCommandRef::SV_UNDEBIT("SV Undebit", 0xBC);
50const CardCommandRef CardCommandRef::INVALIDATE("Invalidate", 0x04);
51const CardCommandRef CardCommandRef::REHABILITATE("Rehabilitate", 0x44);
52const CardCommandRef CardCommandRef::GENERATE_ASYMMETRIC_KEY_PAIR("Generate Asymetric Key Pair", 0x46);
53
54CardCommandRef::CardCommandRef(
55 const std::string& name, const uint8_t instructionByte)
56: mName(name)
57, mInstructionByte(instructionByte)
58{
59}
60
61CardCommandRef::CardCommandRef(const CardCommandRef& o)
62: mName(o.mName)
63, mInstructionByte(o.mInstructionByte)
64{
65}
66
67const std::string&
68CardCommandRef::getName() const
69{
70 return mName;
71}
72
73std::uint8_t
74CardCommandRef::getInstructionByte() const
75{
76 return mInstructionByte;
77}
78
79bool
80CardCommandRef::operator==(const CardCommandRef& o) const
81{
82 return mName == o.mName &&
83 mInstructionByte == o.mInstructionByte;
84}
85
86bool
87CardCommandRef::operator!=(const CardCommandRef& o) const
88{
89 return !(*this == o);
90}
91
92CardCommandRef&
93CardCommandRef::operator=(const CardCommandRef& o)
94{
95 mName = o.mName;
96 mInstructionByte = o.mInstructionByte;
97
98 return *this;
99}
100
101} /* namespace calypso */
102} /* namespace card */
103} /* namespace keyple */