Digital Authentication Framework  6.0.1.37
Public Member Functions | Static Public Attributes | List of all members
DAKey Class Referenceabstract

Interface to Key objects. More...

#include <DigitalAuthenticationFramework.h>

Inheritance diagram for DAKey:
BasicKey BasicReadonlyKey

Public Member Functions

virtual ~DAKey ()
 virtual destructor More...
 
virtual DAMetaDatagetInfo ()=0
 get metadata object describing this key More...
 
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. More...
 
virtual bool setData (const DAData &data)=0
 Set key data. More...
 
virtual bool generateMaterial ()=0
 Generates or regenerates key material. More...
 
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 ( )
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 BasicReadonlyKey, and BasicKey.

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: