7#ifndef LOGICALACCESS_KEY_HPP
8#define LOGICALACCESS_KEY_HPP
15class KeyDiversification;
21 public std::enable_shared_from_this<Key>
46 virtual const unsigned char *
getData()
const = 0;
58 virtual void setData(
const unsigned char *data);
64 virtual void setData(
const ByteVector &data,
size_t offset = 0);
70 std::string getString(
bool withSpace =
true)
const;
87 virtual bool fromString(
const std::string &str);
93 void setKeyStorage(std::shared_ptr<KeyStorage> key_storage);
99 std::shared_ptr<KeyStorage> getKeyStorage()
const;
106 void serialize(boost::property_tree::ptree &node)
override;
112 void unSerialize(boost::property_tree::ptree &node)
override;
119 virtual bool operator==(
const Key &key)
const;
126 virtual bool operator!=(
const Key &key)
const;
132 void setCipherKey(
const std::string &key);
138 void setStoreCipheredData(
bool cipher);
144 bool getStoreCipheredData()
const;
146 void setKeyDiversification(std::shared_ptr<KeyDiversification> div);
148 std::shared_ptr<KeyDiversification> getKeyDiversification()
const;
165 void cipherKeyData(boost::property_tree::ptree &node);
171 void uncipherKeyData(boost::property_tree::ptree &node);
206LLA_CORE_API std::ostream &
operator<<(std::ostream &os,
const Key &key);
A Key base class. The key object is used to describe key chip information used for authentication on ...
Definition: key.hpp:22
virtual unsigned char * getData()=0
Get the key data.
virtual const unsigned char * getData() const =0
Get the key data.
bool d_storeCipheredData
The data is stored ciphered or not.
Definition: key.hpp:197
bool isEmpty() const
Get if key data are empty.
Definition: key.hpp:76
std::string d_cipherKey
The cipher key.
Definition: key.hpp:192
static const std::string secureAiKey
The default 'secure' key for ciphering.
Definition: key.hpp:159
std::shared_ptr< KeyDiversification > d_key_diversification
The key storage used for this key.
Definition: key.hpp:187
bool d_isEmpty
Checked if key data are empty.
Definition: key.hpp:177
virtual size_t getLength() const =0
Get the key length.
std::shared_ptr< KeyStorage > d_key_storage
The key storage used for this key.
Definition: key.hpp:182
A Xml Serializable base class. Add Xml serialization to a class.
Definition: xmlserializable.hpp:54
std::vector< uint8_t > ByteVector
Definition: lla_fwd.hpp:80
LLA_CORE_API std::ostream & operator<<(std::ostream &os, const Key &key)
Output to stream operator.
Definition: key.cpp:298
@ KST_COMPUTER_MEMORY
Definition: keystorage.hpp:18