|
Async 1.8.0
|
A class representing a certificate signing request. More...
#include <AsyncSslCertSigningReq.h>
Public Types | |
| enum | : long { VERSION_1 = 0 } |
Public Member Functions | |
| SslCertSigningReq (void) | |
| Default constructor. | |
| SslCertSigningReq (X509_REQ *req) | |
| Constructor using existing X509_REQ. | |
| SslCertSigningReq (SslCertSigningReq &&other) | |
| Move constructor. | |
| SslCertSigningReq (SslCertSigningReq &other) | |
| Copy constructor. | |
| ~SslCertSigningReq (void) | |
| Constructor taking PEM data. | |
| SslCertSigningReq & | operator= (SslCertSigningReq &other) |
| Copy assignment operator. | |
| SslCertSigningReq & | operator= (SslCertSigningReq &&other) |
| Move assigned operator. | |
| operator const X509_REQ * () const | |
| Cast to a pointer to a X509_REQ object. | |
| void | set (X509_REQ *req) |
| Initialize this object from an existing X509_REQ object. | |
| void | clear (void) |
| Remove all information in this object. | |
| bool | isNull (void) const |
| Check if this object is empty. | |
| bool | setVersion (long version) |
| Set the version of the request. | |
| long | version (void) const |
| Get the version of this CSR. | |
| bool | addSubjectName (const std::string &field, const std::string &value) |
| Add a subject name component. | |
| bool | setSubjectName (X509_NAME *name) |
| Set the subject name from a X509_NAME pointer. | |
| const X509_NAME * | subjectName (void) const |
| Return the subject name as a X509_NAME pointer. | |
| std::vector< unsigned char > | subjectDigest (void) const |
| Get the subject digest. | |
| std::string | subjectNameString (void) const |
| Get the subject DN as a string. | |
| std::string | commonName (void) const |
| Get the subject common name. | |
| void | addExtensions (SslX509Extensions &exts) |
| Add extensions to this CSR. | |
| SslX509Extensions | extensions (void) const |
| Get the extensions in this CSR. | |
| SslKeypair | publicKey (void) const |
| Get the public key. | |
| bool | setPublicKey (SslKeypair &pubkey) |
| Set the public key. | |
| bool | sign (SslKeypair &privkey) |
| Sign the CSR using the given private key. | |
| bool | verify (SslKeypair &pubkey) const |
| Verify the signature of this CSR. | |
| std::vector< unsigned char > | digest (void) const |
| Get the sha256 digest of this CSR. | |
| bool | readPem (const std::string &pem) |
| Read PEM formatted CSR data into this object. | |
| bool | readPemFile (const std::string &filename) |
| Read PEM formatted CSR data from file into this object. | |
| const std::string & | filePath (void) const |
| Get the file path associated with this CSR. | |
| bool | writePemFile (FILE *f) |
| Write the CSR data to a PEM file. | |
| bool | writePemFile (const std::string &filename) |
| Write the CSR data to a PEM file. | |
| bool | appendPemFile (const std::string &filename) |
| Append the CSR data to a PEM file. | |
| std::string | pem (void) const |
| Get the data in this CSR as a PEM string. | |
| void | print (const std::string &prefix="") const |
| Print the info in this CSR to std::cout. | |
A class representing a certificate signing request.
Definition at line 123 of file AsyncSslCertSigningReq.h.
| anonymous enum : long |
| Enumerator | |
|---|---|
| VERSION_1 | |
Definition at line 126 of file AsyncSslCertSigningReq.h.
|
inline |
Default constructor.
Definition at line 134 of file AsyncSslCertSigningReq.h.
|
inline |
Constructor using existing X509_REQ.
| req | An existing X509_REQ |
This object will take ownership of the X509_REQ and so it will be freed at the destruction of this object.
Definition at line 147 of file AsyncSslCertSigningReq.h.
|
inline |
Move constructor.
| other | The other object to move data from |
Definition at line 153 of file AsyncSslCertSigningReq.h.
|
inline |
Copy constructor.
| other | The other object to copy data from |
Definition at line 164 of file AsyncSslCertSigningReq.h.
|
inline |
Constructor taking PEM data.
| pem | The PEM data to parse into a CSR object |
Destructor
Definition at line 186 of file AsyncSslCertSigningReq.h.
|
inline |
Add extensions to this CSR.
| exts | The extensions to add |
Definition at line 418 of file AsyncSslCertSigningReq.h.
|
inline |
Add a subject name component.
| field | The name of the field to add |
| value | The value of the field to add |
Ex: addSubjectName("CN", "host.example.org");
Definition at line 292 of file AsyncSslCertSigningReq.h.
|
inline |
Append the CSR data to a PEM file.
| filename | The path to the file to append PEM data to |
Definition at line 590 of file AsyncSslCertSigningReq.h.
References writePemFile().
|
inline |
Remove all information in this object.
After calling this function the isNull method will return true.
Definition at line 250 of file AsyncSslCertSigningReq.h.
|
inline |
Get the subject common name.
Definition at line 386 of file AsyncSslCertSigningReq.h.
References subjectName().
|
inline |
Get the sha256 digest of this CSR.
Definition at line 492 of file AsyncSslCertSigningReq.h.
|
inline |
Get the extensions in this CSR.
Definition at line 434 of file AsyncSslCertSigningReq.h.
Referenced by print().
|
inline |
Get the file path associated with this CSR.
This CSR is considered associated to a file if the readPemFile method was used to populate it with data.
Definition at line 556 of file AsyncSslCertSigningReq.h.
|
inline |
Check if this object is empty.
Definition at line 263 of file AsyncSslCertSigningReq.h.
|
inline |
Cast to a pointer to a X509_REQ object.
Definition at line 230 of file AsyncSslCertSigningReq.h.
|
inline |
Move assigned operator.
| other | The object to move from |
Definition at line 217 of file AsyncSslCertSigningReq.h.
|
inline |
Copy assignment operator.
| other | The object to copy |
Definition at line 201 of file AsyncSslCertSigningReq.h.
|
inline |
Get the data in this CSR as a PEM string.
Definition at line 599 of file AsyncSslCertSigningReq.h.
Referenced by readPem().
|
inline |
Print the info in this CSR to std::cout.
| prefix | A string to prefix each printed row with |
Definition at line 616 of file AsyncSslCertSigningReq.h.
References extensions(), Async::SslX509Extensions::subjectAltName(), subjectNameString(), and Async::SslX509ExtSubjectAltName::toString().
|
inline |
Get the public key.
Definition at line 444 of file AsyncSslCertSigningReq.h.
|
inline |
Read PEM formatted CSR data into this object.
| pem | The PEM data |
Definition at line 513 of file AsyncSslCertSigningReq.h.
References pem().
|
inline |
Read PEM formatted CSR data from file into this object.
| filename | The name of a file containing a CSR in PEM format |
Definition at line 531 of file AsyncSslCertSigningReq.h.
|
inline |
Initialize this object from an existing X509_REQ object.
| req | Pointer to an existing X509_REQ object |
Definition at line 236 of file AsyncSslCertSigningReq.h.
|
inline |
Set the public key.
| pubkey | The public key to set given as a SslKeypair object |
Definition at line 455 of file AsyncSslCertSigningReq.h.
|
inline |
Set the subject name from a X509_NAME pointer.
| name | The X509_NAME pointer |
Definition at line 314 of file AsyncSslCertSigningReq.h.
|
inline |
Set the version of the request.
| version | The version to set |
The version indicate what information the request can contain.
Ex: setVersion(Async::SslCertSigningReq::VERSION_1);
Definition at line 273 of file AsyncSslCertSigningReq.h.
References version().
|
inline |
Sign the CSR using the given private key.
| The | private key to sign the CSR with |
Definition at line 466 of file AsyncSslCertSigningReq.h.
|
inline |
Get the subject digest.
Definition at line 334 of file AsyncSslCertSigningReq.h.
References subjectName().
|
inline |
Return the subject name as a X509_NAME pointer.
Definition at line 324 of file AsyncSslCertSigningReq.h.
Referenced by commonName(), subjectDigest(), and subjectNameString().
|
inline |
Get the subject DN as a string.
Definition at line 357 of file AsyncSslCertSigningReq.h.
References subjectName().
Referenced by print().
|
inline |
Verify the signature of this CSR.
| pubkey | The public key to use in the verification |
Verify that this CSR was signed using the private key matching the given public key.
Definition at line 482 of file AsyncSslCertSigningReq.h.
|
inline |
Get the version of this CSR.
Definition at line 283 of file AsyncSslCertSigningReq.h.
Referenced by setVersion().
|
inline |
Write the CSR data to a PEM file.
| filename | The path to the file to write PEM data to |
Definition at line 580 of file AsyncSslCertSigningReq.h.
References writePemFile().
|
inline |
Write the CSR data to a PEM file.
| f | An opened file object to write the PEM data to |
Definition at line 563 of file AsyncSslCertSigningReq.h.
Referenced by appendPemFile(), and writePemFile().