140 #if defined(OT_CRYPTO_USING_OPENSSL)
166 if (
nullptr !=
dp)
delete (
dp);
169 #if defined(OT_CRYPTO_USING_OPENSSL)
195 X509* x509 =
nullptr;
196 EVP_PKEY* pNewKey =
nullptr;
203 mkcert(&x509, &pNewKey, nBits, 0, 3650);
208 if (
nullptr == x509) {
209 otErr << __FUNCTION__
210 <<
": Failed attempting to generate new x509 cert.\n";
212 if (
nullptr != pNewKey) EVP_PKEY_free(pNewKey);
218 if (
nullptr == pNewKey) {
219 otErr << __FUNCTION__
220 <<
": Failed attempting to generate new private key.\n";
222 if (
nullptr != x509) X509_free(x509);
260 OT_ASSERT(
nullptr != theKeypair.m_pkeyPublic);
261 OT_ASSERT(
nullptr != theKeypair.m_pkeyPrivate);
271 if (
nullptr == pPublicKey) {
272 otErr << __FUNCTION__ <<
": dynamic_cast to OTAsymmetricKey_OpenSSL "
273 "failed. (theKeypair.m_pkeyPublic)\n";
276 if (
nullptr == pPrivateKey) {
277 otErr << __FUNCTION__ <<
": dynamic_cast to OTAsymmetricKey_OpenSSL "
278 "failed. (theKeypair.m_pkeyPrivate)\n";
289 pPublicKey->
dp->SetKeyAsCopyOf(
302 pPrivateKey->
dp->SetKeyAsCopyOf(
324 #elif defined(OT_CRYPTO_USING_GPG)
bool MakeNewKeypair(int32_t nBits=1024)
OTLOG_IMPORT OTLogStream otErr
OTAsymmetricKey_OpenSSLPrivdp * dp
int32_t mkcert(X509 **x509p, EVP_PKEY **pkeyp, int32_t bits, int32_t serial, int32_t days)
bool SetOntoKeypair(OTKeypair &theKeypair)
OTLowLevelKeyDataOpenSSLdp * dp