Desafio Labsec (SGC)
|
Fourth Milestone - PKCS12 Key Repository More...
#include <FourthMilestone.h>
Public Member Functions | |
FourthMilestone () | |
virtual | ~FourthMilestone () |
void | createUserRepository (Certificate *userCert, KeyPair &userKeyPair) |
void | createRootCaRepository (Certificate *rootCaCert, KeyPair &rootCaKeyPair) |
Public Attributes | |
const char * | userAlias = "userP12" |
const char * | rootCaAlias = "rootP12" |
const char * | userPass = "userpassword" |
const char * | rootCaPass = "rootcapassword" |
Fourth Milestone - PKCS12 Key Repository
It is not a good idea to keep Private Keys in plain text files. You should protect the keys you've just created by using encryption. There are several ways to protect cryptographic keys, the one you are about to implement is a standard called PKCS#12. To create a PKCS#12 file (extension .p12) you will pack together the Private Key and its respective certificate. Both assets have been produced on previous milestones. The key repository's structure is somewhat like this:
<Alias, <Certificate, PrivateKey> >
Alias is the nickname or friendly name given to the tuple <Certificate, PrivateKey>.
SELF EVALUATION (Requires previous milstones to run)
In evaluation folder run '$make fourth'.
You need to implement the evaluation for this milestone.
FourthMilestone::FourthMilestone | ( | ) |
Like any other C++ code, this one needs little hack.
|
virtual |
void FourthMilestone::createRootCaRepository | ( | Certificate * | rootCaCert, |
KeyPair & | rootCaKeyPair | ||
) |
TODO Implement this function in the cpp file.
TODO(milestone4)
void FourthMilestone::createUserRepository | ( | Certificate * | userCert, |
KeyPair & | userKeyPair | ||
) |
TODO Implement this function in the cpp file.
TODO(milestone4)
const char* FourthMilestone::rootCaAlias = "rootP12" |
const char* FourthMilestone::rootCaPass = "rootcapassword" |
const char* FourthMilestone::userAlias = "userP12" |
PKCS12 alias (friendly name)
const char* FourthMilestone::userPass = "userpassword" |
PKCS12 password