class KeyFactoryImpl

This abstract class provides applications with key generation, PEM or DER encoding and decoding for key export and import

Inheritance:


Public Methods

virtual ~KeyFactoryImpl ()
Deletes this object
virtual string getKeyEncoded (const string& format, const PublicKey &key) const
Encodes the public key using a format specified by format
virtual PublicKey initPublicKey (const string& format, const string& encoding) const
Returns a PublicKey
virtual string getKeyEncoded (const string& format, const PrivateKey &key) const
Encodes the private key using a format specified by format
virtual PrivateKey initPrivateKey (const string& format, const string& encoding) const
Returns a PrivateKey
virtual PrivateKey initPrivateKeyFromFile (const string& format, const string& fileName) const
Initiliazes the PrivateKey from a file
virtual KeyPair generateRSAKeyPair (int size = 64, unsigned long exponent = 3) const
Generates an RSA key pair
virtual KeyPair generateDSAKeyPair (int size = 64) const
Generates a DSA key pair

Protected Methods

KeyFactoryImpl ()
Constructs this object

Documentation

This abstract class provides applications with key generation, PEM or DER encoding and decoding for key export and import. Typically, an instance of this class is instantiated and wrapped in a KeyFactory object which is merely a reference-count pointer. Applications should never have to instantiate a subclass of this class. Instead, the KeyFactory#getKeyFactory() should be used.
virtual ~KeyFactoryImpl()
Deletes this object

virtual string getKeyEncoded(const string& format, const PublicKey &key) const
Encodes the public 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 encoding of the key
Parameters:
format - string specifies the format to be used
key - PublicKey to be encoded
See Also:
PublicKey

virtual PublicKey initPublicKey(const string& format, const string& encoding) const
Returns a PublicKey.
Throws:
SecurityException if either format or type is unsupported or if decoding fails
Parameters:
format - the format used for encoding
encoding - a string of bytes
See Also:
PublicKey

virtual string getKeyEncoded(const string& format, const PrivateKey &key) const
Encodes the private 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 of the key
Parameters:
key - PrivateKey to be encoded
format - the format used for encoding
See Also:
PrivateKey

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

virtual PrivateKey initPrivateKeyFromFile(const string& format, const string& fileName) const
Initiliazes the PrivateKey from a file.
Returns:
the Private Key that is initialized from the file
Parameters:
format - specified format of the key, the format currently being supported is PEM
fileName - name of the file that contains the private key

virtual KeyPair generateRSAKeyPair(int size = 64, unsigned long exponent = 3) const
Generates an RSA key pair.
Throws:
SecurityException if generation fails
Returns:
KeyPair pair that holds the private and the public keys
Parameters:
size - int modulo in bytes (power of 2)
size - int exponent a prime number
See Also:
KeyPair
PrivateKey
PublicKey

virtual KeyPair generateDSAKeyPair(int size = 64) const
Generates a DSA key pair.
Throws:
SecurityException if generation fails
Returns:
KeyPair pair that holds the private and the public keys
Parameters:
size - int size of key in bytes
See Also:
KeyPair
PrivateKey
PublicKey

KeyFactoryImpl()
Constructs this object


Direct child classes:
OpenSSLKeyFactoryImpl
Author:
Srilekha Mudumbai Abdelilah Essiari
Version:
1.1 00/05/01
See Also:
KeyFactory
Provider
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