diff --git a/include/opendht/crypto.h b/include/opendht/crypto.h index 59a9eb23ef5ab1b0276abd4bb1062c43341a21a4..c4e2ba293cda7d344548c4fc84a3660f4069f521 100644 --- a/include/opendht/crypto.h +++ b/include/opendht/crypto.h @@ -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: