Desafio Labsec (SGC)
Public Member Functions | Public Attributes | List of all members
ThirdMilestone Class Reference

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"
 

Detailed Description

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.

See also
libcryptosec/RDNSequence
libcryptosec/CertificateBuilder
libcryptosec/KeyPair

SELF EVALUATION (Requires previous milstones to run)
In evaluation folder run '$make third'.

Author
{Lucas Perin}

Constructor & Destructor Documentation

◆ ~ThirdMilestone()

ThirdMilestone::~ThirdMilestone ( )
virtual

Member Function Documentation

◆ createCertificates()

void ThirdMilestone::createCertificates ( KeyPair &  rootCaKeyPair,
KeyPair &  userKeyPair 
)

TODO Implement this function in the cpp file.

TODO(milestone3):

  • create Root Ca Self Signed Certificate;
  • create your certificate issued and signed by Root CA. You are allowed to create new functions to keep your code clean.

◆ setCommonName()

void ThirdMilestone::setCommonName ( CertificateBuilder &  builder,
const char *  cn 
)

TODO Implement this function in the cpp file.

Member Data Documentation

◆ commonName

const char* ThirdMilestone::commonName = "yourName"

TODO define commonName as you name.

◆ rootCaCommonName

const char* ThirdMilestone::rootCaCommonName = "ROOT-CA"

◆ rootCaSerial

const long ThirdMilestone::rootCaSerial = 1

Root CA subject.

◆ serial

const long ThirdMilestone::serial = 12345678

TODO define serial as your enrollment number.

◆ time1

const std::string ThirdMilestone::time1 = "1501010000000"

UTCtime to use for NotBefore and NotAfter. (YYMMDDHHMMSSZ)

◆ time2

const std::string ThirdMilestone::time2 = "1502010000000"

◆ time3

const std::string ThirdMilestone::time3 = "1602010000000"

◆ time4

const std::string ThirdMilestone::time4 = "2001010000000"

The documentation for this class was generated from the following files: