Library: Crypto
Package: CryptoCore
Header: Poco/Crypto/RSAKey.h
Stores an RSAKey
Member Functions: impl, name, save, size
EXP_SMALL = 0
KL_512 = 512
KL_1024 = 1024
KL_2048 = 2048
KL_4096 = 4096
RSAKey(
const Poco::Net::X509Certificate & cert
);
Extracts the RSAKey from the certificate
RSAKey(
KeyLength keyLength,
Exponent exp
);
Creates the RSAKey. Creates a new public/private keypair using the given parameters. Can be used to sign and verify a stream
RSAKey(
const std::string & publicKeyFile,
const std::string & privateKeyFile = "",
const std::string & privateKeyPwd = ""
);
Creates the RSAKey. Can only by used for signing if privateKeyFile is not empty.
RSAKey(
std::istream * pPubKey,
std::istream * pPrivKey = 0,
const std::string & privateKeyPwd = ""
);
Creates the RSAKey. 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.
~RSAKey();
Destroys the RSAKey.
RSAKeyImpl::Ptr impl();
Returns the impl object
const std::string & name() const;
Returns "rsa"
void save(
const std::string & pubKeyFile,
const std::string & privKeyFile = "",
const std::string & privKeyPwd = ""
);
Exports the keys to the given files. pubKeyFile/privKeyFile can be empty
void save(
std::ostream * pPubKey,
std::ostream * pPrivKey = 0,
const std::string & privateKeyPwd = ""
);
Exports the keys to the given streams. pPubKey/pPrivKey can be empty
int size() const;
Returns the RSA_size