RSAKeyImpl::RSAKeyImpl(const X509Certificate& cert): _pRSA(0) { const X509* pCert = cert.certificate(); EVP_PKEY* pKey = X509_get_pubkey(const_cast<X509*>(pCert)); _pRSA = EVP_PKEY_get1_RSA(pKey); }
RSAKeyImpl::RSAKeyImpl(const X509Certificate& cert): KeyPairImpl("rsa", KT_RSA_IMPL), _pRSA(0) { const X509* pCert = cert.certificate(); EVP_PKEY* pKey = X509_get_pubkey(const_cast<X509*>(pCert)); if (pKey) { _pRSA = EVP_PKEY_get1_RSA(pKey); EVP_PKEY_free(pKey); } else throw OpenSSLException("RSAKeyImpl(const X509Certificate&)"); }