LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
aes128key.hpp
Go to the documentation of this file.
1
7#ifndef LOGICALACCESS_AES128KEY_HPP
8#define LOGICALACCESS_AES128KEY_HPP
9
10#include <logicalaccess/key.hpp>
11
15#define AES128_KEY_SIZE 16
16
17namespace logicalaccess
18{
22class LLA_CORE_API AES128Key : public Key
23{
24 public:
25 using XmlSerializable::serialize;
26 using XmlSerializable::unSerialize;
27
31 AES128Key();
32
33 virtual ~AES128Key() = default;
34
39 explicit AES128Key(const std::string &str);
40
46 AES128Key(const void *buf, size_t buflen);
47
51 explicit AES128Key(const ByteVector &data);
52
57 size_t getLength() const override
58 {
59 return AES128_KEY_SIZE;
60 }
61
66 const unsigned char *getData() const override
67 {
68 return d_key;
69 }
70
75 unsigned char *getData() override
76 {
77 return d_key;
78 }
79
85 void serialize(boost::property_tree::ptree &parentNode) override;
86
91 void unSerialize(boost::property_tree::ptree &node) override;
92
97 std::string getDefaultXmlNodeName() const override;
98
103 void fromBytes(const ByteVector &v);
104
105 private:
109 unsigned char d_key[AES128_KEY_SIZE];
110};
111}
112
113#endif /* LOGICALACCESS_AES128KEY_H */
#define AES128_KEY_SIZE
The default aes 128-bit key size.
Definition: aes128key.hpp:15
A AES128 key class.
Definition: aes128key.hpp:23
virtual ~AES128Key()=default
unsigned char * getData() override
Get the key data.
Definition: aes128key.hpp:75
size_t getLength() const override
Get the key length.
Definition: aes128key.hpp:57
const unsigned char * getData() const override
Get the key data.
Definition: aes128key.hpp:66
A Key base class. The key object is used to describe key chip information used for authentication on ...
Definition: key.hpp:22
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
Definition: asn1.hpp:9