Digital Authentication Framework  6.0.1.37
Public Member Functions | Protected Attributes | List of all members
BasicReadonlyKey Class Reference

Simple key implementation for class-0 devices. More...

#include <basic_key.h>

Inheritance diagram for BasicReadonlyKey:
BasicKey DAKey

Public Member Functions

 BasicReadonlyKey (BasicError &err, const DAData &data)
 Constructor. More...
 
virtual bool getData (DAData &out)
 Retrieve key data. More...
 
- Public Member Functions inherited from BasicKey
 BasicKey (BasicError &err)
 Constructor. More...
 
DAMetaDatagetInfo ()
 get metadata object describing this key More...
 
virtual bool encrypt (DAMessage &msg)
 Encrypt the given message Returns success = true.
 
virtual bool decrypt (DAMessage &msg)
 Decrypt the given message Returns success = true.
 
virtual bool sign (DAMessage &msg)
 Sign the given message Returns success = true.
 
virtual bool verify (DAMessage &msg)
 Verify the given message Returns success = true.
 
virtual bool setData (const DAData &data)
 Set key data. More...
 
virtual bool generateMaterial ()
 Generates or regenerates key material. More...
 
virtual std::vector< DAMechanismgetMechanisms ()
 Return a vector of mechanisms supported by this key.
 
void setSerial (const std::string &serial)
 Set serial number to be returned by metadata.
 
- Public Member Functions inherited from DAKey
virtual ~DAKey ()
 virtual destructor More...
 

Protected Attributes

DAData m_bytes
 Data to be returned by getData()
 
- Protected Attributes inherited from BasicKey
BasicErrorm_error
 Reference to object where this key can report errors.
 
BasicMetaData m_meta
 Metadata for this key. Subclasses can set fields within this data.
 

Additional Inherited Members

- Static Public Attributes inherited from DAKey
static const int STORAGE_MESSAGE_SIZE = 32
 Size of random data stored for class-1 keys.
 
static const int ENCRYPT_MESSAGE_SIZE = 32
 Size of plaintext message passed to class 2 and 3 encrypt-decrypt keys.
 
static const int ONEWAY_MESSAGE_SIZE = 32
 Size of plaintext message passed to class 2 and 3 MAC/signature keys.
 
- Protected Member Functions inherited from BasicKey
bool _notImpl ()
 Stub for not-implemented methods: sets a NOT_IMPLEMENTED error and returns false.
 

Detailed Description

Simple key implementation for class-0 devices.

This can be used directly if the key data is known at the time the key object is created. Note that the key data is retained in memory for the lifetime of the object; this may make in unsuitable for high-security applications.

Constructor & Destructor Documentation

BasicReadonlyKey::BasicReadonlyKey ( BasicError err,
const DAData data 
)

Constructor.

Parameters
errreference to the BasicError object for the
datadata block to return from getData() method

Member Function Documentation

virtual bool BasicReadonlyKey::getData ( DAData data)
virtual

Retrieve key data.

This is only called for class-0 and class-1 keys. Keys capable of cryptographic operation should not implement this.

Returns success = true

Reimplemented from BasicKey.


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