Digital Authentication Framework
6.0.1.37
|
Simple implementation of DAMetaData. More...
#include <basic_metadata.h>
Public Types | |
typedef std::vector< DAData > | DADataList |
0, 1 or many data items (e.g. an X.509 certificate chain) | |
Public Member Functions | |
BasicMetaData (BasicError &err) | |
Constructor Produces a metadata container with no values. More... | |
void | copyFrom (const DAMetaData &meta) |
Copy data values from another DAMetaData. More... | |
void | setString (DAAttrib which, const std::string &value) |
Set a string attribute. | |
void | setFlag (DAAttrib which, bool value=true) |
Set a boolean(flag) attribute. | |
void | setData (DAAttrib which, const DAData &value) |
Set a (single) byte-block attribute. | |
void | setData (DAAttrib which, const DADataList &values) |
Sets a (list of) byte-block attributes. | |
void | setSize (DAAttrib which, size_t len) |
Set a size attribute. | |
virtual bool | getString (DAAttrib which, std::string &out) |
Get String attribute. More... | |
virtual bool | getFlag (DAAttrib which) |
Get boolean attribute. More... | |
virtual bool | getData (DAAttrib which, DAData &out, size_t index) |
Get byteblock attribute. More... | |
virtual bool | getSize (DAAttrib which, size_t &len_r) |
Get size attribute. More... | |
Public Member Functions inherited from DAMetaData | |
virtual | ~DAMetaData () |
Virtual Destructor. More... | |
Protected Types | |
typedef std::map< DAAttrib, std::string > | string_map |
Holds string attributes. | |
typedef std::map< DAAttrib, bool > | flag_map |
Holds flag attributes. | |
typedef std::map< DAAttrib, DADataList > | data_map |
Holds data attributes. | |
typedef std::map< DAAttrib, size_t > | size_map |
Holds data attributes. | |
Protected Attributes | |
BasicError & | m_error |
Reference to error object to use on failure. | |
string_map | m_strings |
Map containing all std::string attribute values. | |
flag_map | m_flags |
Map containing all bool attribute values. | |
data_map | m_datas |
Map containing all DAData attribute values. | |
size_map | m_sizes |
Map containing all DASize attribute values. | |
Simple implementation of DAMetaData.
Most DAF implementations can use this directly, assuming the metadata values for the object are available at the time that object is created.
BasicMetaData::BasicMetaData | ( | BasicError & | err | ) |
Constructor Produces a metadata container with no values.
err | is the error reporting object for the object for which this is the metadata. Must be valid throughout the life of this object. |
void BasicMetaData::copyFrom | ( | const DAMetaData & | meta | ) |
Copy data values from another DAMetaData.
meta | Must be a BasicMetaData object (FIXME- fails silently if not) |
Get byteblock attribute.
For DA_CERTIFICATE attributes, index is set to 0 to return the X.509 certificate for the key. If additional certificates are required to validate this, these should be provided for index=1, index=2, and so on. The caller can discover the certificate chain by enumerating successive index values, until the method returns false.
Implements DAMetaData.
|
virtual |
Get boolean attribute.
which | identifies the flag value to query |
Queries whether a particular flag is set. Note that there is no semantic difference between a flag being 'not set' and the flag attribute being 'not present'.
Implements DAMetaData.
|
virtual |
Get size attribute.
Used with DA_SIGNATURE_SIZE and DA_MAX_DECRYPT_SIZE attributes to return the sizes (in bytes) of signatures and decrypted data, respectively. Keys with DA_SMIME_SIGN or DA_TLS_CLIENT_AUTH flags set must also have a DA_SIGNATURE_SIZE attribute. Keys with DA_SMIME_DECRYPT must have DA_MAX_DECRYPT_SIZE.
Implements DAMetaData.
|
virtual |
Get String attribute.
which | Identifies the attribute to get |
data | On return, set to the value of the requested attribute. |
Implements DAMetaData.