LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
hmac1key.hpp
Go to the documentation of this file.
1
7#ifndef LOGICALACCESS_HMAC1KEY_HPP
8#define LOGICALACCESS_HMAC1KEY_HPP
9
10#include <logicalaccess/key.hpp>
11
15#define HMAC1_KEY_SIZE 10
16
17namespace logicalaccess
18{
22class LLA_CORE_API HMAC1Key : public Key
23{
24 public:
28 HMAC1Key();
29
30 virtual ~HMAC1Key() = default;
31
36 explicit HMAC1Key(const std::string &str);
37
43 HMAC1Key(const void *buf, size_t buflen);
44
49 size_t getLength() const override
50 {
51 return HMAC1_KEY_SIZE;
52 }
53
58 const unsigned char *getData() const override
59 {
60 return d_key;
61 }
62
67 unsigned char *getData() override
68 {
69 return d_key;
70 }
71
77 void serialize(boost::property_tree::ptree &parentNode) override;
78
83 void unSerialize(boost::property_tree::ptree &node) override;
84
89 std::string getDefaultXmlNodeName() const override;
90
91 private:
95 unsigned char d_key[HMAC1_KEY_SIZE];
96};
97}
98
99#endif /* LOGICALACCESS_HMAC1KEY_HPP */
A hmac-1 key class.
Definition: hmac1key.hpp:23
virtual ~HMAC1Key()=default
size_t getLength() const override
Get the key length.
Definition: hmac1key.hpp:49
unsigned char * getData() override
Get the key data.
Definition: hmac1key.hpp:67
const unsigned char * getData() const override
Get the key data.
Definition: hmac1key.hpp:58
A Key base class. The key object is used to describe key chip information used for authentication on ...
Definition: key.hpp:22
#define HMAC1_KEY_SIZE
The default hmac-1 key size.
Definition: hmac1key.hpp:15
Definition: asn1.hpp:9