![]() |
Ark Server API (ASE) - Wiki
|
#include <RSAKey.h>
Inheritance diagram for Poco::Crypto::RSAKey:
Collaboration diagram for Poco::Crypto::RSAKey:Public Types | |
| enum | KeyLength { KL_512 = 512 , KL_1024 = 1024 , KL_2048 = 2048 , KL_4096 = 4096 } |
| enum | Exponent { EXP_SMALL = 0 , EXP_LARGE } |
Public Types inherited from Poco::Crypto::KeyPair | |
| enum | Type { KT_RSA = KeyPairImpl::KT_RSA_IMPL , KT_EC = KeyPairImpl::KT_EC_IMPL } |
Public Member Functions | |
| RSAKey (const EVPPKey &key) | |
| RSAKey (const X509Certificate &cert) | |
| Constructs ECKeyImpl by extracting the EC key. | |
| RSAKey (const PKCS12Container &cert) | |
| Extracts the RSA public key from the given certificate. | |
| RSAKey (KeyLength keyLength, Exponent exp) | |
| Extracts the RSA private key from the given certificate. | |
| RSAKey (const std::string &publicKeyFile, const std::string &privateKeyFile="", const std::string &privateKeyPassphrase="") | |
| RSAKey (std::istream *pPublicKeyStream, std::istream *pPrivateKeyStream=0, const std::string &privateKeyPassphrase="") | |
| RSAKey (const RSAKey &other) | |
| RSAKey (RSAKey &&other) noexcept | |
| Copy constructor. | |
| ~RSAKey () | |
| Move constructor. | |
| RSAKey & | operator= (const RSAKey &other) |
| Destroys the RSAKey. | |
| RSAKey & | operator= (RSAKey &&other) noexcept |
| Assignment. | |
| RSAKeyImpl::ByteVec | modulus () const |
| Move assignment. | |
| RSAKeyImpl::ByteVec | encryptionExponent () const |
| Returns the RSA modulus. | |
| RSAKeyImpl::ByteVec | decryptionExponent () const |
| Returns the RSA encryption exponent. | |
| RSAKeyImpl::Ptr | impl () const |
| Returns the RSA decryption exponent. | |
Public Member Functions inherited from Poco::Crypto::KeyPair | |
| KeyPair (KeyPairImpl::Ptr pKeyPairImpl=0) | |
| KeyPair (const KeyPair &other) | |
| Extracts the RSA public key from the given certificate. | |
| KeyPair (KeyPair &&other) noexcept | |
| Copy constructor. | |
| KeyPair & | operator= (const KeyPair &other) |
| Move constructor. | |
| KeyPair & | operator= (KeyPair &&other) noexcept |
| Assignment. | |
| virtual | ~KeyPair () |
| Move assignment. | |
| virtual int | size () const |
| Destroys the KeyPair. | |
| virtual void | save (const std::string &publicKeyPairFile, const std::string &privateKeyPairFile="", const std::string &privateKeyPairPassphrase="") const |
| Returns the RSA modulus size. | |
| virtual void | save (std::ostream *pPublicKeyPairStream, std::ostream *pPrivateKeyPairStream=0, const std::string &privateKeyPairPassphrase="") const |
| KeyPairImpl::Ptr | impl () const |
| const std::string & | name () const |
| Returns the impl object. | |
| Type | type () const |
| Returns key pair name. | |
This class stores an RSA key pair, consisting of private and public key. Storage of the private key is optional.
If a private key is available, the RSAKey can be used for decrypting data (encrypted with the public key) or computing secure digital signatures.
| Poco::Crypto::RSAKey::RSAKey | ( | const EVPPKey & | key | ) |
| Poco::Crypto::RSAKey::RSAKey | ( | const X509Certificate & | cert | ) |
Constructs ECKeyImpl by extracting the EC key.
| Poco::Crypto::RSAKey::RSAKey | ( | const PKCS12Container & | cert | ) |
Extracts the RSA public key from the given certificate.
Extracts the RSA private key from the given certificate.
| Poco::Crypto::RSAKey::RSAKey | ( | const std::string & | publicKeyFile, |
| const std::string & | privateKeyFile = "", | ||
| const std::string & | privateKeyPassphrase = "" ) |
Creates the RSAKey. Creates a new public/private keypair using the given parameters. Can be used to sign data and verify signatures.
| Poco::Crypto::RSAKey::RSAKey | ( | std::istream * | pPublicKeyStream, |
| std::istream * | pPrivateKeyStream = 0, | ||
| const std::string & | privateKeyPassphrase = "" ) |
Creates the RSAKey, by reading public and private key from the given files and using the given passphrase for the private key.
Cannot be used for signing or decryption unless a private key is available.
If a private key is specified, you don't need to specify a public key file. OpenSSL will auto-create the public key from the private key.
| Poco::Crypto::RSAKey::RSAKey | ( | const RSAKey & | other | ) |
Creates the RSAKey, by reading public and private key from the given streams and using the given passphrase for the private key.
Cannot be used for signing or decryption unless a private key is available.
If a private key is specified, you don't need to specify a public key file. OpenSSL will auto-create the public key from the private key.
|
noexcept |
Copy constructor.
| Poco::Crypto::RSAKey::~RSAKey | ( | ) |
Move constructor.
| RSAKeyImpl::ByteVec Poco::Crypto::RSAKey::decryptionExponent | ( | ) | const |
Returns the RSA encryption exponent.
| RSAKeyImpl::ByteVec Poco::Crypto::RSAKey::encryptionExponent | ( | ) | const |
Returns the RSA modulus.
|
inline |
| RSAKeyImpl::ByteVec Poco::Crypto::RSAKey::modulus | ( | ) | const |
Move assignment.