Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Poco::Crypto::KeyPair Class Reference

#include <KeyPair.h>

+ Inheritance diagram for Poco::Crypto::KeyPair:
+ Collaboration diagram for Poco::Crypto::KeyPair:

Public Types

enum  Type { KT_RSA = KeyPairImpl::KT_RSA_IMPL , KT_EC = KeyPairImpl::KT_EC_IMPL }
 

Public Member Functions

 KeyPair (KeyPairImpl::Ptr pKeyPairImpl=0)
 
 KeyPair (const KeyPair &other)
 Extracts the RSA public key from the given certificate.
 
 KeyPair (KeyPair &&other) noexcept
 Copy constructor.
 
KeyPairoperator= (const KeyPair &other)
 Move constructor.
 
KeyPairoperator= (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.
 

Private Attributes

KeyPairImpl::Ptr _pImpl
 Returns key pair type.
 

Detailed Description

This is a parent class for classes storing a key pair, consisting of private and public key. Storage of the private key is optional.

If a private key is available, the KeyPair can be used for decrypting data (encrypted with the public key) or computing secure digital signatures.

Definition at line 32 of file KeyPair.h.

Member Enumeration Documentation

◆ Type

Enumerator
KT_RSA 
KT_EC 

Definition at line 41 of file KeyPair.h.

Constructor & Destructor Documentation

◆ KeyPair() [1/3]

Poco::Crypto::KeyPair::KeyPair ( KeyPairImpl::Ptr pKeyPairImpl = 0)
explicit

◆ KeyPair() [2/3]

Poco::Crypto::KeyPair::KeyPair ( const KeyPair & other)

Extracts the RSA public key from the given certificate.

◆ KeyPair() [3/3]

Poco::Crypto::KeyPair::KeyPair ( KeyPair && other)
noexcept

Copy constructor.

◆ ~KeyPair()

virtual Poco::Crypto::KeyPair::~KeyPair ( )
virtual

Move assignment.

Member Function Documentation

◆ impl()

KeyPairImpl::Ptr Poco::Crypto::KeyPair::impl ( ) const
inline

Exports the public and private key to the given streams.

If a null pointer is passed for a stream, the corresponding key is not exported.

Definition at line 129 of file KeyPair.h.

+ Here is the caller graph for this function:

◆ name()

const std::string & Poco::Crypto::KeyPair::name ( ) const
inline

Returns the impl object.

Definition at line 123 of file KeyPair.h.

+ Here is the call graph for this function:

◆ operator=() [1/2]

KeyPair & Poco::Crypto::KeyPair::operator= ( const KeyPair & other)

Move constructor.

◆ operator=() [2/2]

KeyPair & Poco::Crypto::KeyPair::operator= ( KeyPair && other)
noexcept

Assignment.

◆ save() [1/2]

void Poco::Crypto::KeyPair::save ( const std::string & publicKeyPairFile,
const std::string & privateKeyPairFile = "",
const std::string & privateKeyPairPassphrase = "" ) const
inlinevirtual

Returns the RSA modulus size.

Definition at line 107 of file KeyPair.h.

+ Here is the call graph for this function:

◆ save() [2/2]

void Poco::Crypto::KeyPair::save ( std::ostream * pPublicKeyPairStream,
std::ostream * pPrivateKeyPairStream = 0,
const std::string & privateKeyPairPassphrase = "" ) const
inlinevirtual

Exports the public and private keys to the given files.

If an empty filename is specified, the corresponding key is not exported.

Definition at line 115 of file KeyPair.h.

+ Here is the call graph for this function:

◆ size()

int Poco::Crypto::KeyPair::size ( ) const
inlinevirtual

Destroys the KeyPair.

Definition at line 101 of file KeyPair.h.

+ Here is the call graph for this function:

◆ type()

KeyPair::Type Poco::Crypto::KeyPair::type ( ) const
inline

Returns key pair name.

Definition at line 135 of file KeyPair.h.

+ Here is the call graph for this function:

Member Data Documentation

◆ _pImpl

KeyPairImpl::Ptr Poco::Crypto::KeyPair::_pImpl
private

Returns key pair type.

Definition at line 94 of file KeyPair.h.


The documentation for this class was generated from the following file: