store cert method
This commit is contained in:
parent
d05ccef834
commit
fe65ae4866
2 changed files with 16 additions and 0 deletions
|
@ -53,4 +53,18 @@ namespace firewall
|
|||
this->preferences.putUChar("target", rule_ptr->target);
|
||||
this->preferences.end();
|
||||
}
|
||||
|
||||
void Storage::store_certificate(httpsserver::SSLCert *certificate)
|
||||
{
|
||||
unsigned char *pk_data = certificate->getPKData();
|
||||
uint16_t pk_length = certificate->getPKLength();
|
||||
unsigned char *cert_data = certificate->getCertData();
|
||||
uint16_t cert_length = certificate->getCertLength();
|
||||
this->preferences.begin("certificate", false);
|
||||
this->preferences.putBytes("pk_data", pk_data, sizeof(pk_data));
|
||||
this->preferences.putUInt("pk_length", pk_length);
|
||||
this->preferences.putBytes("cert_data", cert_data, sizeof(cert_data));
|
||||
this->preferences.putUInt("pk_length", cert_length);
|
||||
this->preferences.end();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "Preferences.h"
|
||||
#include "FirewallTypes.h"
|
||||
#include "mbedtls/md.h"
|
||||
#include "SSLCert.hpp"
|
||||
|
||||
namespace firewall
|
||||
{
|
||||
|
@ -17,6 +18,7 @@ namespace firewall
|
|||
void store_amount_of_firewall_rules(const uint8_t);
|
||||
firewall_rule_t *retrieve_firewall_rule(const uint8_t);
|
||||
void store_firewall_rule(const uint8_t &, firewall_rule_t *);
|
||||
void store_certificate(httpsserver::SSLCert *certificate);
|
||||
|
||||
public:
|
||||
Storage();
|
||||
|
|
Reference in a new issue