11#include <openssl/crypto.h>
25 const std::string& subject_name,
27 const std::string& valid_from,
28 size_t validity_period_days)
30 auto identity_key_pair =
31 std::make_shared<ccf::crypto::KeyPair_OpenSSL>(curve_id);
32 priv_key = identity_key_pair->private_key_pem();
34 cert = ccf::crypto::create_self_signed_cert(
39 validity_period_days);
52 const std::string& valid_from,
size_t validity_period_days)
54 return ccf::crypto::create_self_signed_cert(
59 validity_period_days);
69 return std::make_shared<ccf::crypto::KeyPair_OpenSSL>(
priv_key);
size_t size() const
Definition pem.h:61
uint8_t * data()
Definition pem.h:51
CurveID
Definition curve.h:18
std::string get_subject_name(const Pem &cert)
Definition verifier.cpp:53
Definition app_interface.h:14
NetworkIdentity(const std::string &subject_name, ccf::crypto::CurveID curve_id, const std::string &valid_from, size_t validity_period_days)
Definition identity.h:24
ccf::crypto::Pem renew_certificate(const std::string &valid_from, size_t validity_period_days)
Definition identity.h:51
void set_certificate(const ccf::crypto::Pem &new_cert)
Definition identity.h:62
std::shared_ptr< ccf::crypto::KeyPair_OpenSSL > get_key_pair()
Definition identity.h:67
NetworkIdentity()=default
NetworkIdentity(const NetworkIdentity &other)=default
ccf::crypto::Pem cert
Definition identity.h:20
ccf::crypto::Pem priv_key
Definition identity.h:19
bool operator==(const NetworkIdentity &other) const =default
virtual ~NetworkIdentity()
Definition identity.h:46