In file /home/eternity/Source/Mix/AddressManager/H/addressManager.h:

class AddressManager : public Debugable, public MixOffspring, public Registerable

Mix address manager

Inheritance:

AddressManager < Debugable

AddressManager < MixOffspring

AddressManager < Registerable


Public Methods

AddressManager::AddressManager (Acs * parent, LogFile * addressManagerLogFile)
Address manager constructor
AddressManager::AddressManager (Mix * parent, LogFile * addressManagerLogFile)
AddressManager constructor
void AddressManager::CertificatesArrived (GMessage *data)
Stores incoming certificates
GMessage* AddressManager::CreateAcsCertificate ()
Create Acs certifcate
Err AddressManager::CreateMixCertificate (u_short port, GMessage **certificate)
Creates a new Mix's certificate
void AddressManager::DownloadCertificates (Size count, string type)
Sends a request to ACS for certificates
GMessage* AddressManager::GetMixCertificate ()
Get Mix certificate
void AddressManager::HereYouAre (GMessage * data)
Store given certificates
Err AddressManager::LoadCertificates ()
Load certificates from disk
Err AddressManager::LoadCertificates ()
Stores given certificates
Err AddressManager::ReturnAcsCertificate ( GMessage **acsCertificate)
Returns a certificate of any Acs
Err AddressManager::ReturnLocalMixCertificate ( GMessage **mixCertificate)
Returns Mix's own certificate
Err AddressManager::ReturnMixCertificate ( GMessage **mixCertificate)
Returns a certificate of any Mix
Err AddressManager::SaveCertificates ()
Save certificates to disk
Err AddressManager::SaveCertificates ()
Saves certificates from memory onto the disk
void AddressManager::Shutdown ()
Prepare for clean shutdown
void AddressManager::Shutdown ()
For shutdowning, not implemented
Err AddressManager::StoreAsymetricKeyPairOntoDisk (GMessage *asymetricKeyPair)
When creating a new certificate, it saves asymetric key pair onto the disk
AddressManager::~AddressManager ()
Acs address manger destructor
AddressManager::~AddressManager ()
Address Manager destructor

Public

methods

Protected

attributes
methods
void DownloadCertificates (Size count, string type)
downloading certificates from ACS
Err SaveCertificates ()
Storing certificates to disk
Err LoadCertificates ()
Loading certificates from disk

Inherited from Debugable:

Public Methods

string* Debugable::CreateString(char *firstStr, int firstInt, int secondInt)
Debugable::Debugable(LogFile * debugLogFile)
int Debugable::SetDebugOptions(int newLogOptions)
void Debugable::SetLogFile(LogFile *aLogFile)
void Debugable::WriteString(LogLevel debugLevel, char * format, ...)
Debugable::~Debugable()

Inherited from MixOffspring:

Public Methods

MixOffspring::MixOffspring(Mix * mix)

Inherited from Registerable:


Documentation

Mix address manager. Takes care of generation storage and expiration of mix's access certificates. This includes access certificates of Acs' and other Mixes.
attributes

methods

void DownloadCertificates(Size count, string type)
downloading certificates from ACS

Err SaveCertificates()
Storing certificates to disk

Err LoadCertificates()
Loading certificates from disk

methods

AddressManager::AddressManager(Acs * parent, LogFile * addressManagerLogFile)
Address manager constructor. Loads Acs certificate from file and if it is not present there then it generates a new one which is written to disk for fututre use.
Author:
Venca
See Also:
CFG_CERTIFICATES_DIRECTORY, CFG_CERTIFICATE

AddressManager::AddressManager(Mix * parent, LogFile * addressManagerLogFile)
AddressManager constructor. Responsible for loading Mix's certificate into memory. Creates the certificate if it is not found.
Parameters:
parent - Pointer to the Mix object.
addressManagerLogFile - Log File.
Author:
Venca, Pechy
See Also:
certificate, Cipherer

void AddressManager::CertificatesArrived(GMessage *data)
Stores incoming certificates. Stores certificates from ACS to its internal structure. Asumes that it gets a GMessage of certificates, that are GMessages too.
Returns:
void
Parameters:
data - Certificates.
GM_CERTIFICATE_1
GM_CERTIFICATE_2
...
GM_CERTIFICATE_"n"

Author:
Venca
See Also:
certificates, Acs, GMessage

GMessage* AddressManager::CreateAcsCertificate()
Create Acs certifcate. Generates an Acs certificate when there is missing.

Structure of the certificate is:

 
Certificate-Type: Acs
Name: acs-johny
Mix-Certificate: 
Address:
...
Port
Author:
Venca
See Also:
AddressManager, Acs

Err AddressManager::CreateMixCertificate(u_short port, GMessage **certificate)
Creates a new Mix's certificate. Finds out the hostname of Mix and creates the new certificate and stores it onto the disk.
Returns:
GM_CERTIFICATE_TYPE	- the name of a server
GM_ADDRESS			- DNS of IP address
GM_PORT			- port where the server is running
GM_PUBLIC_KEY_INFO		- public key from the server's key pair
GM_NOT_VALID_BEFORE	- validity
GM_NOT_VALID_AFTER		- validity
Parameters:
port - Port which we include in the new certificate.
certificate - Where we return the certificate.
See Also:
Cipherer, certificates

void AddressManager::DownloadCertificates(Size count, string type)
Sends a request to ACS for certificates. When some Six asks for certificates and Mix doesn't have enough of them of this type, we have to download them from an Acs.
Returns:
void
Parameters:
count - How many certificates to download.
type - What certificate to download.
Author:
Venca
See Also:
certificates, Acs

GMessage* AddressManager::GetMixCertificate()
Get Mix certificate. Returns a Mix certificate stored on disk.
Author:
Venca
See Also:
GetAcsCertificate

void AddressManager::HereYouAre(GMessage * data)
Store given certificates. When Address Manager asks for certificates, this method is called when certificates are returned, ready to be stored.
Returns:
void
Parameters:
data - Certificates.
Author:
Venca
See Also:
certificates

Err AddressManager::LoadCertificates()
Load certificates from disk. Forces certificate repository to load all certificates from disk.
Author:
Venca
See Also:
SaveCertificates()

Err AddressManager::LoadCertificates()
Stores given certificates. When Address Manager asks for certificates, this method is called when certificates are returned ready to be stored.
Returns:
void
Parameters:
data - Certificates.
Author:
Venca
See Also:
certificates

Err AddressManager::ReturnAcsCertificate( GMessage **acsCertificate)
Returns a certificate of any Acs. Returns a certificate of any Acs.
Returns:
KO if not found, OK otherwise.
Parameters:
acsCertificate - Where to return the certificate.
Author:
Venca
See Also:
certificates

Err AddressManager::ReturnLocalMixCertificate( GMessage **mixCertificate)
Returns Mix's own certificate. Returns Mix's own certificate, that is stored somewhere in the disk. We consider the Mix machine as a safe one.
Returns:
KO if not found, OK otherwise.
Parameters:
mixCertificate - Where to return the certificate.
Author:
Venca
See Also:
certificates

Err AddressManager::ReturnMixCertificate( GMessage **mixCertificate)
Returns a certificate of any Mix. Returns a certificate of any Mix. These certificates should be in repository. If there are not enough of certificates, a request for Acs is made and sent.
Returns:
KO if not found, OK otherwise.
Parameters:
mixCertificate - Where to return the certificate.
Author:
Venca
See Also:
certificates

Err AddressManager::SaveCertificates()
Save certificates to disk. Forces certificate repository to save all certificates to disk.
Author:
Venca
See Also:
LoadCertificates()

Err AddressManager::SaveCertificates()
Saves certificates from memory onto the disk. Saves certificates from memory onto the disk. This method is called before destroying the object AddressManager.
Returns:
KO if not succesful, OK otherwise
Parameters:
void -
Author:
Venca
See Also:
certificates

void AddressManager::Shutdown()
Prepare for clean shutdown. This method should implement all the tasks necessary for preparation for a clean shutdown like saving inconsistent data to disk etc. Now it is empty as AddressManger is completely stateless as it stores certificate to disk immediatelly after it is generated.
Author:
Venca
See Also:
Shutdownable, Killer

void AddressManager::Shutdown()
For shutdowning, not implemented. For shutdowning, not implemented. This method should be called whenever a SIGTERM is caugth.
Author:
Venca
See Also:

Err AddressManager::StoreAsymetricKeyPairOntoDisk(GMessage *asymetricKeyPair)
When creating a new certificate, it saves asymetric key pair onto the disk. Saves asymetric key pait onto the disk. This can happen when creating a new certificate (we have to create the new pair, too).
Returns:
KO if the pair can't be saved, OK otherwise.
Parameters:
asymetricKeyPair - Key pair to store.
Author:
Pechy
See Also:
Cipherer

AddressManager::~AddressManager()
Acs address manger destructor. It just deletes Acs certificate from memory.
Author:
Venca
See Also:
AddressManager(), Acs

AddressManager::~AddressManager()
Address Manager destructor. Destructs Mix's certificate in memory.
Author:
Venca
See Also:


This class has no child classes.
Author:
Pechy, Venca
See Also:
Mix, CertificateRepository

alphabetic index hierarchy of classes


generated by doc++