class OpenSSLKeyFactoryImpl

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

Inheritance:


Public Methods

[more] OpenSSLKeyFactoryImpl ()
Construct this object
[more] ~OpenSSLKeyFactoryImpl ()
Delete this object
[more]string getKeyEncoded (const string& format, const PublicKey& key) const
Encodes the key using a format specified by format.
[more]string getKeyEncoded (const string& format, const PrivateKey& key) const
Encodes the key using a format specified by format.
[more]PublicKey initPublicKey (const string& format, const string& encoding) const
returns a PublicKey.
[more]PrivateKey initPrivateKey (const string& format, const string& encoding) const
returns a PrivateKey.
[more]PrivateKey initPrivateKeyFromFile (const string& format, const string& fileName) const
[more]KeyPair generateRSAKeyPair (int size, unsigned long exponent) const
Generates an RSA key pair.
[more]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.

o OpenSSLKeyFactoryImpl()
Construct this object

o ~OpenSSLKeyFactoryImpl()
Delete this object

ostring 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
Parameters:
- format string specifies the format to be used. Only DER for now.
key - PublicKey to be encoded
Returns:
string the encoding using the format specified
See Also:
PublicKey

ostring 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
Parameters:
- format string specifies the format to be used. Only DER for now.
key - PrivateKey to be encoded
Returns:
encoding a string of bytes
See Also:
PrivateKey

oPublicKey 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
Parameters:
- format string specifies the format used for encoding
type - the key's type
encoding - a string of bytes
Returns:
a public key
See Also:
PublicKey

oPrivateKey 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
Parameters:
- format string specifies the format used for encoding
type - the key's type
encoding - a string of bytes
Returns:
a public key
See Also:
PrivateKey

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

oKeyPair generateRSAKeyPair(int size, unsigned long exponent) const
Generates an RSA key pair.

Throws:
SecurityException if genaration fails
Parameters:
- size int modulo in bytes (power of 2)
- size int exponent a prime number
Returns:
a KeyPair
See Also:
KeyPair
PrivateKey
PublicKey

oKeyPair generateDSAKeyPair(int size) const
Generates a DSA key pair.

Throws:
SecurityException if genaration fails
Parameters:
- size int size of key in bytes
Returns:
a KeyPair
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 HTML hierarchy of classes or Java



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