Skip to content
Snippets Groups Projects
Commit 8dacf142 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

crypto: add Certificate::getRawCopy()

parent 4540be74
Branches
No related tags found
No related merge requests found
......@@ -399,6 +399,13 @@ struct OPENDHT_PUBLIC Certificate {
static Certificate generate(const PrivateKey& key, const std::string& name = "dhtnode", Identity ca = {}, bool is_ca = false);
gnutls_x509_crt_t getRawCopy() const {
auto copy = Certificate(getPacked());
gnutls_x509_crt_t ret = copy.cert;
copy.cert = nullptr;
return ret;
}
gnutls_x509_crt_t cert {};
std::shared_ptr<Certificate> issuer {};
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment