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

Sixth Milestone - Digital Signature More...

#include <SixthMilestone.h>

Public Member Functions

 SixthMilestone ()
 
virtual ~SixthMilestone ()
 
ByteArray sign (ByteArray &data, Pkcs12 &userP12)
 
bool verifySignature (ByteArray &data, ByteArray &signature, Pkcs12 &userP12)
 

Detailed Description

Sixth Milestone - Digital Signature

Last milestone you ecnrypted and later decrypted some text using your public and private keys. When using a public-key cryptosystem you have the ability to encrypt and decrypt data using different keys. Basically, if you choose one key to encrypt, the other one is the only key capable of decrypting your data. This is how we sign data.

Signing documents is usually done by encrypting the hash output of a document using your Private Key. If you keep this Private Key a secret and protect it properly, other parties may use your public key to verify if the document was indeed signed by you. In other words, if you are the only person to have access to your private key, then you are the only person capable of producing this signature.

To verify a signature, all there is to do is decrypt the document's signature using the public key. Take the original document's hash output and compare to the result you obtained by decrypting the signature. If they match, you have a valid signature.

In this milestone, you will produce a signature of paths::plainText using your PKCS12 file.

See also
libcryptosec/Signer

SELF EVALUATION (Requires previous milstones to run)
In evaluation folder run '$make sixth'.
You need to implement the evaluation for this milestone.

Author
Lucas Perin

Constructor & Destructor Documentation

◆ SixthMilestone()

SixthMilestone::SixthMilestone ( )

Like any other C++ code, this one needs little hack.

◆ ~SixthMilestone()

SixthMilestone::~SixthMilestone ( )
virtual

Member Function Documentation

◆ sign()

ByteArray SixthMilestone::sign ( ByteArray &  data,
Pkcs12 &  userP12 
)

TODO Implement this function in the cpp file.

TODO(milestone6)

◆ verifySignature()

bool SixthMilestone::verifySignature ( ByteArray &  data,
ByteArray &  signature,
Pkcs12 &  userP12 
)

TODO Implement this function in the cpp file.

TODO(milestone6)


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