Digital Authentication Framework 6.0.1.33
Public Member Functions | Static Public Attributes

DAKey Class Reference

Interface to Key objects. More...

#include <DigitalAuthenticationFramework.h>

Inheritance diagram for DAKey:
BasicKey BasicReadonlyKey

List of all members.

Public Member Functions

virtual ~DAKey ()
 virtual destructor
virtual DAMetaDatagetInfo ()=0
 get metadata object describing this key
virtual bool encrypt (DAMessage &msg)=0
 Encrypt the given message Returns success = true.
virtual bool decrypt (DAMessage &msg)=0
 Decrypt the given message Returns success = true.
virtual bool sign (DAMessage &msg)=0
 Sign the given message Returns success = true.
virtual bool verify (DAMessage &msg)=0
 Verify the given message Returns success = true.
virtual bool getData (DAData &data)=0
 Retrieve key data.
virtual bool setData (const DAData &data)=0
 Set key data.
virtual bool generateMaterial ()=0
 Generates or regenerates key material.
virtual std::vector< DAMechanismgetMechanisms ()=0
 Return a vector of mechanisms supported by this key.

Static Public Attributes

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.

Detailed Description

Interface to Key objects.

Keys are owned by DASession objects, and operate on DAMessages.


Constructor & Destructor Documentation

virtual DAKey::~DAKey ( ) [inline, virtual]

virtual destructor


Member Function Documentation

virtual bool DAKey::generateMaterial ( ) [pure virtual]

Generates or regenerates key material.

For class-1 keys, this is called during the 'change passphrase' sequence to roll over a key. This should replace the key's current value with new, random data. This method may return a NOT_IMPLEMENTED error, in which case the DAF logic will call setData().

Returns success = true, false if error

Implemented in BasicKey.

virtual bool DAKey::getData ( DAData data) [pure 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

Implemented in BasicKey, and BasicReadonlyKey.

virtual DAMetaData& DAKey::getInfo ( ) [pure virtual]

get metadata object describing this key

Implemented in BasicKey.

virtual bool DAKey::setData ( const DAData data) [pure virtual]

Set key data.

For class-1 keys, this is called during the 'change 'passphrase' sequence, if generateMaterial() returns a NOT_IMPLEMENTED error. The data to be stored will be 32 bytes (STORAGE_MESSAGE_SIZE) bytes long. If the key cannot store messages of this size, it must implement the generateMaterial() method.

Returns success = true

Implemented in BasicKey.


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