LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
nxpav2keydiversification.hpp
Go to the documentation of this file.
1#ifndef NXPAV2KEYDIVERSIFICATION_HPP__
2#define NXPAV2KEYDIVERSIFICATION_HPP__
3
7#include <vector>
8#include <string>
9
10namespace logicalaccess
11{
12class LLA_CARDS_DESFIRE_API NXPAV2KeyDiversification : public NXPKeyDiversification
13{
14 public:
15 void initDiversification(ByteVector identifier, unsigned int AID,
16 std::shared_ptr<Key> key, unsigned char keyno,
17 ByteVector &diversify) override;
18 ByteVector getDiversifiedKey(std::shared_ptr<Key> key, ByteVector diversify) override;
19
21 : d_revertAID(false)
22 , d_forceK2Use(false)
23 {
24 }
25
26 explicit NXPAV2KeyDiversification(const ByteVector &divInput)
27 : d_revertAID(false)
28 , d_divInput(divInput)
29 , d_forceK2Use(false)
30 {
31 }
32
34 {
35 }
36
37 std::string getKeyDiversificationType() override
38 {
39 return "NXPAV2";
40 }
41
42 void serialize(boost::property_tree::ptree &parentNode) override;
43 void unSerialize(boost::property_tree::ptree &node) override;
44 std::string getDefaultXmlNodeName() const override
45 {
46 return "NXPAV2KeyDiversification";
47 }
48
49 bool getRevertAID() const
50 {
51 return d_revertAID;
52 }
53
54 void setRevertAID(bool revertAID)
55 {
56 d_revertAID = revertAID;
57 }
58
59 bool getForceK2Use() const
60 {
61 return d_forceK2Use;
62 }
63
64 void setForceK2Use(bool forceK2Use)
65 {
66 d_forceK2Use = forceK2Use;
67 }
68
69 const ByteVector &getDivInput() const
70 {
71 return d_divInput;
72 }
73
74 void setDivInput(ByteVector divInput)
75 {
76 d_divInput = divInput;
77 }
78
80 {
81 return d_systemIdentifier;
82 }
83
84 void setSystemIdentifier(ByteVector systemIdentifier)
85 {
86 d_systemIdentifier = systemIdentifier;
87 }
88
89 private:
91
93
95
97};
98}
99
100#endif
Definition: nxpav2keydiversification.hpp:13
bool getRevertAID() const
Definition: nxpav2keydiversification.hpp:49
virtual ~NXPAV2KeyDiversification()
Definition: nxpav2keydiversification.hpp:33
ByteVector d_systemIdentifier
Definition: nxpav2keydiversification.hpp:94
NXPAV2KeyDiversification()
Definition: nxpav2keydiversification.hpp:20
const ByteVector & getSystemIdentifier() const
Definition: nxpav2keydiversification.hpp:79
void setDivInput(ByteVector divInput)
Definition: nxpav2keydiversification.hpp:74
bool d_forceK2Use
Definition: nxpav2keydiversification.hpp:96
ByteVector d_divInput
Definition: nxpav2keydiversification.hpp:92
std::string getKeyDiversificationType() override
Definition: nxpav2keydiversification.hpp:37
std::string getDefaultXmlNodeName() const override
Get the default Xml Node name for this object.
Definition: nxpav2keydiversification.hpp:44
void setRevertAID(bool revertAID)
Definition: nxpav2keydiversification.hpp:54
NXPAV2KeyDiversification(const ByteVector &divInput)
Definition: nxpav2keydiversification.hpp:26
bool getForceK2Use() const
Definition: nxpav2keydiversification.hpp:59
void setSystemIdentifier(ByteVector systemIdentifier)
Definition: nxpav2keydiversification.hpp:84
bool d_revertAID
Definition: nxpav2keydiversification.hpp:90
const ByteVector & getDivInput() const
Definition: nxpav2keydiversification.hpp:69
void setForceK2Use(bool forceK2Use)
Definition: nxpav2keydiversification.hpp:64
Definition: nxpkeydiversification.hpp:13
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Definition: asn1.hpp:9