ESP32 HTTPS Server
|
Certificate and private key that can be passed to the HTTPSServer. More...
#include <SSLCert.hpp>
Public Member Functions | |
SSLCert (unsigned char *certData=NULL, uint16_t certLength=0, unsigned char *pkData=NULL, uint16_t pkLength=0) | |
Creates a new SSLCert. More... | |
uint16_t | getCertLength () |
Returns the length of the certificate in byte. | |
uint16_t | getPKLength () |
Returns the length of the private key in byte. | |
unsigned char * | getCertData () |
Returns the certificate data. | |
unsigned char * | getPKData () |
Returns the private key data. | |
void | setPK (unsigned char *_pkData, uint16_t length) |
Sets the private key in DER format. More... | |
void | setCert (unsigned char *_certData, uint16_t length) |
Sets the certificate data in DER format. More... | |
void | clear () |
Clears the key buffers and deletes them. | |
Certificate and private key that can be passed to the HTTPSServer.
Converting PEM to DER Files
Certificate:
Private Key:
Converting DER File to C Header
httpsserver::SSLCert::SSLCert | ( | unsigned char * | certData = NULL , |
uint16_t | certLength = 0 , |
||
unsigned char * | pkData = NULL , |
||
uint16_t | pkLength = 0 |
||
) |
Creates a new SSLCert.
The certificate and key data may be NULL (default values) if the certificate is meant to be passed to createSelfSignedCert().
Otherwise, the data must reside in a memory location that is not deleted until the server using the certificate is stopped.
[in] | certData | The certificate data to use (DER format) |
[in] | certLength | The length of the certificate data |
[in] | pkData | The private key data to use (DER format) |
[in] | pkLength | The length of the private key |
void httpsserver::SSLCert::setCert | ( | unsigned char * | _certData, |
uint16_t | length | ||
) |
Sets the certificate data in DER format.
The data has to reside in a place in memory that is not deleted as long as the server is running.
See SSLCert for some information on how to generate DER data.
[in] | _certData | The data of the certificate |
[in] | length | The length of the certificate |
void httpsserver::SSLCert::setPK | ( | unsigned char * | _pkData, |
uint16_t | length | ||
) |
Sets the private key in DER format.
The data has to reside in a place in memory that is not deleted as long as the server is running.
See SSLCert() for some information on how to generate DER data.
[in] | _pkData | The data of the private key |
[in] | length | The length of the private key |