#include <Cert.h>
Public Methods | |
Cert () | |
~Cert () | |
bool | load (char *file) |
bool | verify (Cert &signed_cert) |
X509 * | getCert (void) |
Static Public Methods | |
bool | generateRandomCerts (char *working_dir, char *openssl_conf, char *cert, char *priv, char *priv_passwd) |
Static Private Methods | |
bool | createFile (char *file_name, char *contents) |
void | deleteFile (char *file_name) |
Private Attributes | |
X509 * | m_cert |
========== Cert Class ========== Cert is a class which contains certificates. Cert load certificates and generates cert files at random. ======== Cert API ======== Member Variables m_cert: openssl cert structure. Member Functions Cert() is a constructor. ~Cert() is a destructor. load() loads cerificates from a file. ex) cert.load("cert.pem"); // cert loads certificates from "cert.pem". verify() checks if a given cert is signed with this cert. ex) cert1.verify(cert2); // return true if cert2 is signed with cert1, // otherwise return false. getCert() returns the openssl cert structure. generateRandomCerts() generates a cert file and a private key file. example: // Generate "./cert.pem" and "./priv.pem". // "./cert.pem" is a generated cert file which contains certificates // and its public key. // "./priv.pem" is a generated private key file which contains // a public and private key pair. // "./priv.pem" is encrypted with a key "testpasswd". // "./openssl.cnf" is a configuration file for openssl. // "/tmp" is a tmp directory where temporary files are created // and deleted. Cert::generateRandomCerts("/tmp", "./openssl.cnf", "./cert.pem", "./priv.pem", "testpasswd");
Definition at line 13 of file Cert.h.
|
|
|
|
|
Create a file with initial contents.
Definition at line 351 of file Cert.cpp. Referenced by generateRandomCerts().
|
|
Delete a file.
Definition at line 373 of file Cert.cpp. Referenced by generateRandomCerts().
|
|
Generate random certificates.
|
|
Get cert in X509 format. Definition at line 184 of file Cert.cpp. Referenced by Rsa::loadKey().
|
|
Load cerficates from file.
|
|
Verify if signed_cert is signed with this cert.
|
|
|