class Akenti::KeyFactoryImpl

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

Inheritance:


Public Methods

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

Protected Methods

[more] 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.

ovirtual ~KeyFactoryImpl()
Deletes this object

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

ovirtual PublicKey initPublicKey(const string& format, const string& encoding) const = 0
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

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

ovirtual PrivateKey initPrivateKey(const string& format, const string& encoding) const = 0
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
Parameters:
- format string specifies the format used for encding
type - the key's type
encoding - a string of bytes
Returns:
PrivateKey
See Also:
PrivateKey

ovirtual PrivateKey initPrivateKeyFromFile(const string& format, const string& fileName) const = 0
Initiliazes the PrivateKey from a 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
Returns:
the Private Key that is initialized from the file

ovirtual KeyPair generateRSAKeyPair(int size = 64, unsigned long exponent = 3) const = 0
Generates an RSA key pair.

Throws:
SecurityException if generation fails
Parameters:
- size int modulo in bytes (power of 2)
- size int exponent a prime number
Returns:
KeyPair pair that holds the private and the public keys
See Also:
KeyPair
PrivateKey
PublicKey

ovirtual KeyPair generateDSAKeyPair(int size = 64) const = 0
Generates a DSA key pair.

Throws:
SecurityException if generation fails
Parameters:
- size int size of key in bytes
Returns:
KeyPair pair that holds the private and the public keys
See Also:
KeyPair
PrivateKey
PublicKey

o 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 HTML hierarchy of classes or Java



This page was generated with the help of DOC++.