#include <StateInfo.h>
Public Types | |
|
typedef map< CODEX_Events::Activity *, ClientActivity * > | ClientMap |
| Map an activity to itself as a derived type. | |
|
typedef map< const unsigned char *, CODEX_Events::Activity *, CODEX_Quorum::memless< CODEX_Server::ServerState::nMID > > | RequestMap |
| Map a sequence number to an Activity. | |
| typedef map< CODEX_ASN1::ustring, KeyInfo * > | KeyMap |
| Map a key name to its information. | |
| typedef CODEX_Server::ServerState::ShareType | ShareType |
| Shorthand for type of a share. | |
| typedef CODEX_Server::ServerState::LSType | LSType |
| Shorthand for a labelled share type. | |
|
typedef CryptoSystem< CODEX_Client::CipherTextType, ShareType > | CryptoSystemType |
| Set up some configuration-specific typedefs. | |
| typedef CryptoSystemType::ThresholdType | ThresholdDecryptionType |
| Specify the threshold scheme to use for decryptions. | |
| enum | SynchronyState |
| Indicates the result of a call to synchronize(). | |
Public Methods | |
| void | configure (const CONF *conf, const char *sec, const string &fname) |
| Configure the state from an OpenSSL CONF-format file. | |
| void | setMessageDomain (unsigned char d) |
| Set the 1-byte domain identifier for client messages. | |
| void | setDelegationDomain (unsigned char d) |
| Set the 1-byte domain identifier for internal delegation messages. | |
| unsigned char | messageDomain () |
| |
| unsigned char | delegationDomain () |
| |
| long | clientPort () const |
| |
| bool | addClient (ClientActivity *clientAct) |
| Add a new ClientActivity to the client map. | |
| ClientActivity * | getClient (CODEX_Events::Activity *clientAct) const |
| |
| bool | removeClient (CODEX_Events::Activity *clientAct) |
| Remote a ClientActivity from the map. | |
| bool | registerSequenceNumber (const unsigned char *seqNum, CODEX_Events::Activity *clientAct) |
| Affiliate a sequence number with an activity, so that cleanup of bad connections can be done. | |
| CODEX_Events::Activity * | getActFromSeqNum (const unsigned char *seqNum) const |
| Given a sequence number, return the ClientActivity for which the request is acting. | |
| bool | removeSequenceNumber (const unsigned char *seqNum) |
| Remove a sequence number. | |
| bool | addKeyName (const CODEX_ASN1::ustring &name, const CODEX_Client::SignedBoundNameMsg &binding) |
| Add a new key name and its binding to the key map. | |
| bool | addKeyName (const CODEX_ASN1::ustring &name, const CODEX_Client::BoundNameMsg &binding) |
| Add a new key name and its binding to the key map. | |
| const KeyInfo * | getKeyInfo (const CODEX_ASN1::ustring &name) const |
| |
| bool | addKeySignature (const CODEX_ASN1::ustring &name, const CODEX_Ciphers::RSASignature &signature) |
| Add a signature to a binding. | |
| bool | replaceKeyBinding (const CODEX_ASN1::ustring &name, const CODEX_Client::SignedBoundNameMsg &binding) |
| Replace a binding with a signed binding. | |
| bool | addKeyValue (const CODEX_ASN1::ustring &name, const CODEX_Client::RequestCipherTextType &keyValue) |
| Add a key value for an already-bound key name. | |
| bool | verifyKeyValue (const CODEX_ASN1::ustring &name) |
| Add a bit indicating that a key value is verified. | |
| const LSType & | decryptionShares (const LSType::LabelType &label, unsigned int server) const |
| The shares of the private key used to perform decryptions. | |
| const LSType::LabelType & | defaultDecryptionLabel () const |
| |
| const ThresholdDecryptionType & | thresholdDecryption () const |
| |
| template<class T> const LSType & | shareTemplate (const LSType::LabelType &label, unsigned int server) const |
| This templated method does type distinction for us, which makes switching between cryptosystems somewhat cleaner. | |
| template<class T> const LSType::LabelType & | labelTemplate () const |
| This templated method does type distinction for us, which makes switching between cryptosystems somewhat cleaner. | |
| template<class T> const T & | thresholdTemplate () const |
| This templated method does type distinction for us, which makes switching between cryptosystems somewhat cleaner. | |
| unsigned int | ppkSecurityParam () const |
| SynchronyState | synchronize (const char *fname, bool force_read=false) |
| Synchronize the object state with stable storage. | |
Static Public Methods | |
| StateInfo * | instance () |
| Static method to fetch the unique instance. | |
| void | destroy () |
| Destroys the unique instance. | |
Protected Methods | |
| StateInfo () | |
| Protected constructor, prevents multiple instances. | |
| virtual | ~StateInfo () |
| Protected virtual destructor. | |
Static Protected Attributes | |
| StateInfo * | m_instance = 0 |
| Unique instance of this class. | |
Implementing the state this way allows us not to have to pass pointers and references to the state everywhere. There is, of course, the danger that something that really shouldn't be accessing the state will be able to, but since the server code has to be trusted on that server in any event, this shouldn't matter. The state information can also be saved to and read from disk, so that state can persist between sessions.
Definition at line 166 of file CODEX_KeyService/StateInfo.h.
|
|
Map a key name to its information.
Definition at line 197 of file CODEX_KeyService/StateInfo.h. |
|
|
Add a new ClientActivity to the client map.
Definition at line 293 of file CODEX_KeyService/StateInfo.cc. |
|
||||||||||||
|
The shares of the private key used to perform decryptions.
Definition at line 498 of file CODEX_KeyService/StateInfo.cc. Referenced by CODEX_KeyService::ClientMessageSigner::handler(). |
|
|
Given a sequence number, return the ClientActivity for which the request is acting.
Definition at line 364 of file CODEX_KeyService/StateInfo.cc. Referenced by CODEX_KeyService::ResponseCallback::fail(), CODEX_KeyService::VerifyWriteCallback::operator()(), CODEX_KeyService::SignWriteCallback::operator()(), CODEX_KeyService::SignReadCallback::operator()(), CODEX_KeyService::SignCreateCallback::operator()(), CODEX_KeyService::ClientWriteCallback::operator()(), CODEX_KeyService::ClientReadCallback::operator()(), and CODEX_KeyService::ClientCreateCallback::operator()(). |
|
|
Definition at line 370 of file CODEX_KeyService/StateInfo.h. |
|
||||||||||||
|
Synchronize the object state with stable storage.
Snapshots can be implemented using different file names at specified points. If the file does not exist, it will be created. If the state information is empty, a read will be attempted. Otherwise a write will be attempted unless force_read is
Definition at line 68 of file CODEX_KeyService/StateInfo.cc. References CODEX_ASN1::OctetString::marshal(), CODEX_ASN1::Integer::marshal(), CODEX_KeyService::KeyInfo::unmarshal(), CODEX_ASN1::OctetString::unmarshal(), CODEX_ASN1::Integer::unmarshal(), CODEX_ASN1::OctetString::value(), and CODEX_ASN1::Integer::value(). |
1.2.18