Ark Server API (ASE) - Wiki
|
#include <EVPPKey.h>
Public Member Functions | |
EVPPKey (const std::string &ecCurveName) | |
EVPPKey (const char *ecCurveName) | |
EVPPKey (EVP_PKEY *pEVPPKey) | |
template<typename K > | |
EVPPKey (K *pKey) | |
EVPPKey (const std::string &publicKeyFile, const std::string &privateKeyFile, const std::string &privateKeyPassphrase="") | |
EVPPKey (std::istream *pPublicKeyStream, std::istream *pPrivateKeyStream, const std::string &privateKeyPassphrase="") | |
EVPPKey (const EVPPKey &other) | |
EVPPKey (EVPPKey &&other) noexcept | |
Copy constructor. | |
EVPPKey & | operator= (const EVPPKey &other) |
Move constructor. | |
EVPPKey & | operator= (EVPPKey &&other) noexcept |
Assignment operator. | |
~EVPPKey () | |
Assignment move operator. | |
bool | operator== (const EVPPKey &other) const |
Destroys the EVPPKey. | |
bool | operator!= (const EVPPKey &other) const |
void | save (const std::string &publicKeyFile, const std::string &privateKeyFile="", const std::string &privateKeyPassphrase="") const |
void | save (std::ostream *pPublicKeyStream, std::ostream *pPrivateKeyStream=0, const std::string &privateKeyPassphrase="") const |
int | type () const |
bool | isSupported (int type) const |
Retuns the EVPPKey type NID. | |
operator const EVP_PKEY * () const | |
Returns true if OpenSSL type is supported. | |
operator EVP_PKEY * () | |
Returns const pointer to the OpenSSL EVP_PKEY structure. | |
Static Public Member Functions | |
static EVP_PKEY * | duplicate (const EVP_PKEY *pFromKey, EVP_PKEY **pToKey) |
Returns pointer to the OpenSSL EVP_PKEY structure. | |
Private Types | |
typedef EVP_PKEY *(* | PEM_read_FILE_Key_fn) (FILE *, EVP_PKEY **, pem_password_cb *, void *) |
typedef EVP_PKEY *(* | PEM_read_BIO_Key_fn) (BIO *, EVP_PKEY **, pem_password_cb *, void *) |
typedef void *(* | EVP_PKEY_get_Key_fn) (EVP_PKEY *) |
Private Member Functions | |
EVPPKey () | |
Duplicates pFromKey into *pToKey and returns. | |
void | newECKey (const char *group) |
void | duplicate (EVP_PKEY *pEVPPKey) |
void | setKey (ECKey *pKey) |
void | setKey (RSAKey *pKey) |
void | setKey (EC_KEY *pKey) |
void | setKey (RSA *pKey) |
Static Private Member Functions | |
static int | type (const EVP_PKEY *pEVPPKey) |
static int | passCB (char *buf, int size, int, void *pass) |
template<typename K , typename F > | |
static bool | loadKey (K **ppKey, PEM_read_FILE_Key_fn readFunc, F getFunc, const std::string &keyFile, const std::string &pass="") |
template<typename K , typename F > | |
static bool | loadKey (K **ppKey, PEM_read_BIO_Key_fn readFunc, F getFunc, std::istream *pIstr, const std::string &pass="") |
Private Attributes | |
EVP_PKEY * | _pEVPPKey |
Friends | |
class | ECKeyImpl |
class | RSAKeyImpl |
Utility class for conversion of native keys to EVP. Currently, only RSA and EC keys are supported.
|
private |
|
private |
|
private |
|
explicit |
|
explicit |
|
explicit |
|
inlineexplicit |
Poco::Crypto::EVPPKey::EVPPKey | ( | const std::string & | publicKeyFile, |
const std::string & | privateKeyFile, | ||
const std::string & | privateKeyPassphrase = "" ) |
Poco::Crypto::EVPPKey::EVPPKey | ( | std::istream * | pPublicKeyStream, |
std::istream * | pPrivateKeyStream, | ||
const std::string & | privateKeyPassphrase = "" ) |
Creates the EVPPKey, by reading public and private key from the given files and using the given passphrase for the private key. Can only by used for signing if a private key is available.
Poco::Crypto::EVPPKey::EVPPKey | ( | const EVPPKey & | other | ) |
Creates the EVPPKey. Can only by used for signing if pPrivKey is not null. If a private key file is specified, you don't need to specify a public key file. OpenSSL will auto-create it from the private key.
|
noexcept |
Copy constructor.
Poco::Crypto::EVPPKey::~EVPPKey | ( | ) |
Assignment move operator.
|
private |
Duplicates pFromKey into *pToKey and returns.
|
static |
Returns pointer to the OpenSSL EVP_PKEY structure.
|
private |
|
inline |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
private |
|
inline |
|
inline |
|
inline |
Comparison operator. Returns true if public key components and parameters of the other key are equal to this key.
Works as expected when one key contains only public key, while the other one contains private (thus also public) key.
Definition at line 304 of file EVPPKey.h.
|
inline |
|
staticprivate |
void Poco::Crypto::EVPPKey::save | ( | const std::string & | publicKeyFile, |
const std::string & | privateKeyFile = "", | ||
const std::string & | privateKeyPassphrase = "" ) const |
Comparison operator. Returns true if public key components and parameters of the other key are different from this key.
Works as expected when one key contains only public key, while the other one contains private (thus also public) key.
void Poco::Crypto::EVPPKey::save | ( | std::ostream * | pPublicKeyStream, |
std::ostream * | pPrivateKeyStream = 0, | ||
const std::string & | privateKeyPassphrase = "" ) const |
Exports the public and/or private keys to the given files.
If an empty filename is specified, the corresponding key is not exported.
|
inlineprivate |
|
private |
|
inlineprivate |
|
private |
|
inline |
|
inlinestaticprivate |
|
friend |