Desafio Labsec (SGC)
|
Third Milestone - x.509 Certificates More...
#include <ThirdMilestone.h>
Public Member Functions | |
virtual | ~ThirdMilestone () |
void | setCommonName (CertificateBuilder &builder, const char *cn) |
void | createCertificates (KeyPair &rootCaKeyPair, KeyPair &userKeyPair) |
Public Attributes | |
const long | serial = 12345678 |
const char * | commonName = "yourName" |
const long | rootCaSerial = 1 |
const char * | rootCaCommonName = "ROOT-CA" |
const std::string | time1 = "1501010000000" |
const std::string | time2 = "1502010000000" |
const std::string | time3 = "1602010000000" |
const std::string | time4 = "2001010000000" |
Third Milestone - x.509 Certificates
From now on, milestones may get harder. For this milestone, you will create two Certificates. The first one for the Root Certification Authority and the second is for yourself. The Root CA's certificate is self signed, meaning it will use its own Private Key to sign its certificate. Your certificate will be signed by the Root CA's Private Key as well. You should read about Public Key Infrastructure to better understand about this next task.
Tips: The Subject of a x.509 certificate is a sequence of fields {Common Name, Country, Organization, ...}. For this milestone, you need only to add the Common Name entry to the data structure (RDNSequence).
The Issuer of a certificate is the subject of the certificate used to sign it. For a ROOT Certification Authority, the issuer is its own subject. For you certificate, the issuer will be the subject of the Root CA.
The NotBefore and NotAfter fields are used to determine whetheri the certificate is valid or not.
SELF EVALUATION (Requires previous milstones to run)
In evaluation folder run '$make third'.
|
virtual |
void ThirdMilestone::createCertificates | ( | KeyPair & | rootCaKeyPair, |
KeyPair & | userKeyPair | ||
) |
TODO Implement this function in the cpp file.
TODO(milestone3):
void ThirdMilestone::setCommonName | ( | CertificateBuilder & | builder, |
const char * | cn | ||
) |
TODO Implement this function in the cpp file.
const char* ThirdMilestone::commonName = "yourName" |
TODO define commonName as you name.
const char* ThirdMilestone::rootCaCommonName = "ROOT-CA" |
const long ThirdMilestone::rootCaSerial = 1 |
Root CA subject.
const long ThirdMilestone::serial = 12345678 |
TODO define serial as your enrollment number.
const std::string ThirdMilestone::time1 = "1501010000000" |
UTCtime to use for NotBefore and NotAfter. (YYMMDDHHMMSSZ)
const std::string ThirdMilestone::time2 = "1502010000000" |
const std::string ThirdMilestone::time3 = "1602010000000" |
const std::string ThirdMilestone::time4 = "2001010000000" |