Poco::Crypto

class RSAKeyImpl

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

Description

class RSAKeyImpl

Inheritance

Direct Base Classes: Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject

Member Summary

Member Functions: getRSA, save, size

Inherited Functions: duplicate, referenceCount, release

Types

Ptr

typedef Poco::AutoPtr < RSAKeyImpl > Ptr;

Constructors

RSAKeyImpl

RSAKeyImpl(
    const Poco::Net::X509Certificate & cert
);

Extracts the RSAKey from the certificate

RSAKeyImpl

RSAKeyImpl(
    int keyLength,
    unsigned long exponent
);

Creates the RSAKeyImpl.

RSAKeyImpl

RSAKeyImpl(
    const std::string & publicKey,
    const std::string & privateKeyFile,
    const std::string & privateKeyPwd
);

Creates the RSAKeyImpl.

RSAKeyImpl

RSAKeyImpl(
    std::istream * pPubKey,
    std::istream * pPrivKey,
    const std::string & privateKeyPwd
);

Creates the RSAKeyImpl. privKey is an optional parameter which can be null.

Destructor

~RSAKeyImpl virtual

~RSAKeyImpl();

Destroys the RSAKeyImpl.

Member Functions

getRSA inline

RSA * getRSA();

Returns the openssl rsa object

getRSA

const RSA * getRSA() const;

Returns the openssl rsa object

save

void save(
    const std::string & pubKeyFile,
    const std::string & privKeyFile,
    const std::string & privKeyPwd
);

Exports the keys to the given files. privKeyFile can be empty

save

void save(
    std::ostream * pPubKey,
    std::ostream * pPrivKey,
    const std::string & privateKeyPwd
);

Exports the keys to the given streams. Can be empty

size

int size() const;

Returns the RSA_size