LibLogicalAccess
2.5.0
An Open Source RFID Library
|
A Key storage base class. The key storage specify where the key is stored in memory. It can have cryptographic functionalities. More...
#include <keystorage.hpp>
Public Member Functions | |
virtual | ~KeyStorage ()=default |
virtual KeyStorageType | getType () const =0 |
Get the key storage type. | |
void | serialize (boost::property_tree::ptree &parentNode) override |
Serialize object to Xml Node. | |
void | unSerialize (boost::property_tree::ptree &node) override |
UnSerialize object from a Xml Node. | |
std::string | getMetadata (const std::string &key) |
bool | hasMetadata (const std::string &key) const |
void | addMetadata (const std::string &key, const std::string &value) |
virtual std::string | serialize () |
Serialize object to Xml Node string. | |
virtual void | serialize (boost::property_tree::ptree &parentNode)=0 |
Serialize object to Xml Node. | |
virtual void | unSerialize (boost::property_tree::ptree &node)=0 |
UnSerialize object from a Xml Node. | |
virtual void | unSerialize (const std::string &xmlstring, const std::string &rootNode) |
UnSerialize object from a Xml Node string. | |
virtual void | unSerialize (std::istream &is, const std::string &rootNode) |
UnSerialize object from a Xml node. | |
virtual void | unSerialize (boost::property_tree::ptree &node, const std::string &rootNode) |
UnSerialize object from a Xml node. | |
![]() | |
virtual | ~XmlSerializable ()=default |
virtual std::string | serialize () |
Serialize object to Xml Node string. | |
virtual std::string | serializeWithHeaders () |
Serialize object to Xml Node string, with xml headers. | |
virtual void | serialize (boost::property_tree::ptree &parentNode)=0 |
Serialize object to Xml Node. | |
virtual void | serializeToFile (const std::string &filename) |
Serialize object to a Xml file. | |
virtual void | unSerialize (boost::property_tree::ptree &node)=0 |
UnSerialize object from a Xml Node. | |
virtual void | unSerialize (const std::string &xmlstring, const std::string &rootNode) |
UnSerialize object from a Xml Node string. | |
virtual void | unSerialize (std::istream &is, const std::string &rootNode) |
UnSerialize object from a Xml node. | |
virtual void | unSerialize (boost::property_tree::ptree &node, const std::string &rootNode) |
UnSerialize object from a Xml node. | |
virtual void | unSerializeFromFile (const std::string &filename) |
UnSerialize object from a Xml file. | |
virtual std::string | getDefaultXmlNodeName () const =0 |
Get the default Xml Node name for this object. | |
Static Public Member Functions | |
static std::shared_ptr< KeyStorage > | getKeyStorageFromType (KeyStorageType kst) |
Get the key storage instance from a key storage type. | |
![]() | |
static std::string | removeXmlDeclaration (const std::string &xmlstring) |
Remove Xml declaration from a xml string. | |
static ByteVector | formatHexString (std::string hexstr) |
Format hex string to hex string with space. | |
Protected Attributes | |
std::map< std::string, std::string > | metadata_ |
Additional Inherited Members | |
![]() | |
static unsigned long long | atoull (const std::string &str) |
A Key storage base class. The key storage specify where the key is stored in memory. It can have cryptographic functionalities.
|
virtualdefault |
void logicalaccess::KeyStorage::addMetadata | ( | const std::string & | key, |
const std::string & | value | ||
) |
Add a new metadata to the KeyStorage
|
static |
Get the key storage instance from a key storage type.
std::string logicalaccess::KeyStorage::getMetadata | ( | const std::string & | key | ) |
Retrieve an entry from the metadata key/value store
|
pure virtual |
Get the key storage type.
Implemented in logicalaccess::ComputerMemoryKeyStorage, logicalaccess::IKSStorage, logicalaccess::PKCSKeyStorage, logicalaccess::ReaderMemoryKeyStorage, and logicalaccess::SAMKeyStorage.
bool logicalaccess::KeyStorage::hasMetadata | ( | const std::string & | key | ) | const |
Check whether or not a metadata named "key" is available
|
virtual |
Serialize object to Xml Node string.
Reimplemented from logicalaccess::XmlSerializable.
|
overridevirtual |
Serialize object to Xml Node.
os | The XML stream. |
Implements logicalaccess::XmlSerializable.
Reimplemented in logicalaccess::PKCSKeyStorage, logicalaccess::ReaderMemoryKeyStorage, logicalaccess::SAMKeyStorage, and logicalaccess::ComputerMemoryKeyStorage.
|
virtual |
Serialize object to Xml Node.
os | The XML stream. |
Implements logicalaccess::XmlSerializable.
|
overridevirtual |
UnSerialize object from a Xml Node.
node | The Xml node. |
Implements logicalaccess::XmlSerializable.
Reimplemented in logicalaccess::PKCSKeyStorage, logicalaccess::ReaderMemoryKeyStorage, logicalaccess::SAMKeyStorage, and logicalaccess::ComputerMemoryKeyStorage.
|
virtual |
UnSerialize object from a Xml Node.
node | The Xml node. |
Implements logicalaccess::XmlSerializable.
|
virtual |
UnSerialize object from a Xml node.
node | The Xml node. |
rootNode | The root node. |
Reimplemented from logicalaccess::XmlSerializable.
|
virtual |
UnSerialize object from a Xml Node string.
xmlstring | The Xml Node string. |
rootNode | The root node. |
Reimplemented from logicalaccess::XmlSerializable.
|
virtual |
UnSerialize object from a Xml node.
is | The Xml stream. |
rootNode | The root node. |
Reimplemented from logicalaccess::XmlSerializable.
|
protected |