Poco::Crypto

class KeyPairImpl

File Information

Library: Crypto
Package: CryptoCore
Header: Poco/Crypto/KeyPairImpl.h

Description

Class KeyPairImpl

Inheritance

Direct Base Classes: Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject

Known Derived Classes: RSAKeyImpl, ECKeyImpl

Member Summary

Member Functions: name, save, size, type

Inherited Functions: duplicate, referenceCount, release

Types Aliases

ByteVec

using ByteVec = std::vector < unsigned char >;

Ptr

using Ptr = Poco::AutoPtr < KeyPairImpl >;

Enumerations

Type

KT_RSA_IMPL = 0

KT_EC_IMPL

Constructors

KeyPairImpl

KeyPairImpl(
    const std::string & name,
    Type type
);

Create KeyPairImpl with specified type and name.

Destructor

~KeyPairImpl virtual

virtual ~KeyPairImpl();

Destroys the KeyPairImpl.

Member Functions

name inline

const std::string & name() const;

Returns key pair name

save virtual

virtual void save(
    const std::string & publicKeyFile,
    const std::string & privateKeyFile = "",
    const std::string & privateKeyPassphrase = ""
) const = 0;

Exports the public and private keys to the given files.

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

save virtual

virtual void save(
    std::ostream * pPublicKeyStream,
    std::ostream * pPrivateKeyStream = 0,
    const std::string & privateKeyPassphrase = ""
) const = 0;

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.

size virtual

virtual int size() const = 0;

Returns the key size.

type inline

Type type() const;

Returns key pair type

Securely control IoT edge devices from anywhere   Connect a Device