|
|
@ -697,7 +697,7 @@ namespace openssl { |
|
|
|
rsa(o); |
|
|
|
rsa(o); |
|
|
|
dsa(o); |
|
|
|
dsa(o); |
|
|
|
dh(o); |
|
|
|
dh(o); |
|
|
|
ec(o); |
|
|
|
/*ec(o);*/ |
|
|
|
} |
|
|
|
} |
|
|
|
std::string string(BIGNUM* a) const { |
|
|
|
std::string string(BIGNUM* a) const { |
|
|
|
std::string res(BN_num_bytes(a), '0'); |
|
|
|
std::string res(BN_num_bytes(a), '0'); |
|
|
@ -717,10 +717,12 @@ namespace openssl { |
|
|
|
DH* tmp(o.dh()); |
|
|
|
DH* tmp(o.dh()); |
|
|
|
if (tmp&&!EVP_PKEY_set1_DH(_key, tmp)) throw key_copy_failed(); |
|
|
|
if (tmp&&!EVP_PKEY_set1_DH(_key, tmp)) throw key_copy_failed(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* Not available on mac osx
|
|
|
|
void ec(const PrivateKey& o) { |
|
|
|
void ec(const PrivateKey& o) { |
|
|
|
EC_KEY* tmp(o.ec()); |
|
|
|
EC_KEY* tmp(o.ec()); |
|
|
|
if (tmp&&!EVP_PKEY_set1_EC_KEY(_key, tmp)) throw key_copy_failed(); |
|
|
|
if (tmp&&!EVP_PKEY_set1_EC_KEY(_key, tmp)) throw key_copy_failed(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
RSA* rsa() const { |
|
|
|
RSA* rsa() const { |
|
|
|
//! @todo throw exception if 0?
|
|
|
|
//! @todo throw exception if 0?
|
|
|
|
return EVP_PKEY_get1_RSA(_key); |
|
|
|
return EVP_PKEY_get1_RSA(_key); |
|
|
@ -731,9 +733,10 @@ namespace openssl { |
|
|
|
DH* dh() const { |
|
|
|
DH* dh() const { |
|
|
|
return EVP_PKEY_get1_DH(_key); |
|
|
|
return EVP_PKEY_get1_DH(_key); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* Not available on mac osx
|
|
|
|
EC_KEY* ec() const { |
|
|
|
EC_KEY* ec() const { |
|
|
|
return EVP_PKEY_get1_EC_KEY(_key); |
|
|
|
return EVP_PKEY_get1_EC_KEY(_key); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
EVP_PKEY* _key; |
|
|
|
EVP_PKEY* _key; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|