Digital Authentication Framework
6.0.1.37
|
Interface to Key objects. More...
#include <DigitalAuthenticationFramework.h>
Public Member Functions | |
virtual | ~DAKey () |
virtual destructor More... | |
virtual DAMetaData & | getInfo ()=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< DAMechanism > | getMechanisms ()=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. | |
Interface to Key objects.
Keys are owned by DASession objects, and operate on DAMessages.
|
virtual |
virtual destructor
|
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.
|
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.
|
pure virtual |
get metadata object describing this key
Implemented in BasicKey.
|
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.