LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
logicalaccess::KeyStorage Class Referenceabstract

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>

Inheritance diagram for logicalaccess::KeyStorage:
logicalaccess::XmlSerializable logicalaccess::ComputerMemoryKeyStorage logicalaccess::IKSStorage logicalaccess::PKCSKeyStorage logicalaccess::ReaderMemoryKeyStorage logicalaccess::SAMKeyStorage

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.
 
- Public Member Functions inherited from logicalaccess::XmlSerializable
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< KeyStoragegetKeyStorageFromType (KeyStorageType kst)
 Get the key storage instance from a key storage type.
 
- Static Public Member Functions inherited from logicalaccess::XmlSerializable
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 Protected Member Functions inherited from logicalaccess::XmlSerializable
static unsigned long long atoull (const std::string &str)
 

Detailed Description

A Key storage base class. The key storage specify where the key is stored in memory. It can have cryptographic functionalities.

Constructor & Destructor Documentation

◆ ~KeyStorage()

virtual logicalaccess::KeyStorage::~KeyStorage ( )
virtualdefault

Member Function Documentation

◆ addMetadata()

void logicalaccess::KeyStorage::addMetadata ( const std::string &  key,
const std::string &  value 
)

Add a new metadata to the KeyStorage

◆ getKeyStorageFromType()

std::shared_ptr< KeyStorage > logicalaccess::KeyStorage::getKeyStorageFromType ( KeyStorageType  kst)
static

Get the key storage instance from a key storage type.

Returns
The key storage instance.

◆ getMetadata()

std::string logicalaccess::KeyStorage::getMetadata ( const std::string &  key)

Retrieve an entry from the metadata key/value store

◆ getType()

virtual KeyStorageType logicalaccess::KeyStorage::getType ( ) const
pure virtual

◆ hasMetadata()

bool logicalaccess::KeyStorage::hasMetadata ( const std::string &  key) const

Check whether or not a metadata named "key" is available

◆ serialize() [1/3]

std::string logicalaccess::XmlSerializable::serialize ( )
virtual

Serialize object to Xml Node string.

Returns
The serialized object.

Reimplemented from logicalaccess::XmlSerializable.

◆ serialize() [2/3]

void logicalaccess::KeyStorage::serialize ( boost::property_tree::ptree &  parentNode)
overridevirtual

◆ serialize() [3/3]

virtual void logicalaccess::XmlSerializable::serialize ( boost::property_tree::ptree &  parentNode)
virtual

Serialize object to Xml Node.

Parameters
osThe XML stream.

Implements logicalaccess::XmlSerializable.

◆ unSerialize() [1/5]

void logicalaccess::KeyStorage::unSerialize ( boost::property_tree::ptree &  node)
overridevirtual

◆ unSerialize() [2/5]

virtual void logicalaccess::XmlSerializable::unSerialize ( boost::property_tree::ptree &  node)
virtual

UnSerialize object from a Xml Node.

Parameters
nodeThe Xml node.

Implements logicalaccess::XmlSerializable.

◆ unSerialize() [3/5]

void logicalaccess::XmlSerializable::unSerialize ( boost::property_tree::ptree &  node,
const std::string &  rootNode 
)
virtual

UnSerialize object from a Xml node.

Parameters
nodeThe Xml node.
rootNodeThe root node.
Returns
True on success, false otherwise.

Reimplemented from logicalaccess::XmlSerializable.

◆ unSerialize() [4/5]

void logicalaccess::XmlSerializable::unSerialize ( const std::string &  xmlstring,
const std::string &  rootNode 
)
virtual

UnSerialize object from a Xml Node string.

Parameters
xmlstringThe Xml Node string.
rootNodeThe root node.
Returns
True on success, false otherwise.

Reimplemented from logicalaccess::XmlSerializable.

◆ unSerialize() [5/5]

void logicalaccess::XmlSerializable::unSerialize ( std::istream &  is,
const std::string &  rootNode 
)
virtual

UnSerialize object from a Xml node.

Parameters
isThe Xml stream.
rootNodeThe root node.
Returns
True on success, false otherwise.

Reimplemented from logicalaccess::XmlSerializable.

Member Data Documentation

◆ metadata_

std::map<std::string, std::string> logicalaccess::KeyStorage::metadata_
protected

The documentation for this class was generated from the following files: