class OpenSSLKeyFactoryImpl : public KeyFactoryImpl

This class is a subclass of KeyFactoryImpl which has methods for key generation, encoding, and decoding

Inheritance:


Public Methods

OpenSSLKeyFactoryImpl ()
Construct this object
~OpenSSLKeyFactoryImpl ()
Delete this object
string getKeyEncoded (const string& format, const PublicKey& key) const
Encodes the key using a format specified by format
string getKeyEncoded (const string& format, const PrivateKey& key) const
Encodes the key using a format specified by format
PublicKey initPublicKey (const string& format, const string& encoding) const
returns a PublicKey
PrivateKey initPrivateKey (const string& format, const string& encoding) const
returns a PrivateKey
PrivateKey initPrivateKeyFromFile (const string& format, const string& fileName) const
KeyPair generateRSAKeyPair (int size, unsigned long exponent) const
Generates an RSA key pair
KeyPair generateDSAKeyPair (int size) const
Generates a DSA key pair

Inherited from KeyFactoryImpl:


Documentation

This class is a subclass of KeyFactoryImpl which has methods for key generation, encoding, and decoding. a pair of RSA or DSA keyPairs will be generated by calling generateRSAKeyPair()or generateDSAKeyPair(). a privateKey or publicKey can be encoded by calling getKeyEncoded() with the format specified as "DER". a privateKey or publicKey class can be initialized from a DER string by calling initPrivateKey() or initPublicKey(). Both RSA and DSA keys are currently handled.
OpenSSLKeyFactoryImpl()
Construct this object

~OpenSSLKeyFactoryImpl()
Delete this object

string getKeyEncoded(const string& format, const PublicKey& key) const
Encodes the key using a format specified by format.
Throws:
SecurityException if format is unsupported or if the encoding fails
Error if key is unitialized or unrecognized
Returns:
string the encoding using the format specified
Parameters:
format - string specifies the format to be used. Only DER for now.
key - PublicKey to be encoded
See Also:
PublicKey

string getKeyEncoded(const string& format, const PrivateKey& key) const
Encodes the key using a format specified by format.
Throws:
SecurityException if format is unsupported or if the encoding fails
Error if key is uninitialized or unrecognized
Returns:
encoding a string of bytes
Parameters:
format - string specifies the format to be used. Only DER for now.
key - PrivateKey to be encoded
See Also:
PrivateKey

PublicKey initPublicKey(const string& format, const string& encoding) const
returns a PublicKey. The format specifies which format was used to encode the key (must be DER for now). The type specifies the kind of key we are decoding. Examples of types are DSA and RSA.
Throws:
SecurityException if either format or type is unsupported or if decoding fails
Returns:
a public key
Parameters:
format - string specifies the format used for encoding
type - the key's type
encoding - a string of bytes
See Also:
PublicKey

PrivateKey initPrivateKey(const string& format, const string& encoding) const
returns a PrivateKey. The format specifies which format was used to encode the key ( must be DER for now ) . The type specifies the kind of key we are decoding. Examples of types are DSA and RSA.
Throws:
SecurityException if either format or type is unsupported or if decoding fails
Returns:
a public key
Parameters:
format - string specifies the format used for encoding
type - the key's type
encoding - a string of bytes
See Also:
PrivateKey

PrivateKey initPrivateKeyFromFile(const string& format, const string& fileName) const

KeyPair generateRSAKeyPair(int size, unsigned long exponent) const
Generates an RSA key pair.
Throws:
SecurityException if genaration fails
Returns:
a KeyPair
Parameters:
size - int modulo in bytes (power of 2)
size - int exponent a prime number
See Also:
KeyPair
PrivateKey
PublicKey

KeyPair generateDSAKeyPair(int size) const
Generates a DSA key pair.
Throws:
SecurityException if genaration fails
Returns:
a KeyPair
Parameters:
size - int size of key in bytes
See Also:
KeyPair
PrivateKey
PublicKey


This class has no child classes.
Author:
Srilekha Mudumbai Abdelilah Essiari
Version:
1.1 00/05/01
See Also:
PublicKey
PrivateKey
KeyPair

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de