Package g4ds :: Package algorithms :: Module algorithminterface :: Class AlgorithmInterface
[show private | hide private]
[frames | no frames]

Class AlgorithmInterface

Known Subclasses:
AlgorithmImplementation, AlgorithmImplementation

Provides a common interface for all implementations for algorithms.
Method Summary
  __init__(self, name)
Just ot set up the name of the implementation.
  createKeyPair(self, bitlength)
Creates a key pair for the algorithm.
String decrypt(self, ciphertext, keyst)
Decrypts the ciphertext.
String encrypt(self, plaintext, keyst)
Encrypts the plain text.
  getName(self)
GETTER
  getPublicKey(self, privateKeySt)
Returns the public part of the key pair.
  setKeyPair(self, key)
SETTER
String signMessage(self, message, keyst)
Provides a signature for the given message.
Boolean validate(self, message, signature, keyst)
Verifies, whether the exactly this message has been signed with the corresponding private key for this public key.

Instance Variable Summary
String _name: Name of the Implementation

Method Details

__init__(self, name)
(Constructor)

Just ot set up the name of the implementation.

createKeyPair(self, bitlength=None)

Creates a key pair for the algorithm.

decrypt(self, ciphertext, keyst=None)

Decrypts the ciphertext.
Returns:
The plain text
           (type=String)

encrypt(self, plaintext, keyst)

Encrypts the plain text.
Returns:
The corresponding cipher text
           (type=String)

getName(self)

GETTER

getPublicKey(self, privateKeySt=None)

Returns the public part of the key pair.

setKeyPair(self, key)

SETTER

signMessage(self, message, keyst=None)

Provides a signature for the given message.
Parameters:
message - Message to be signed (usually plain text)
           (type=String)
keyst - Private key to use for signing - if none given, the one stored in the instance will be used
           (type=String)
Returns:
Corresponding Signature
           (type=String)

validate(self, message, signature, keyst)

Verifies, whether the exactly this message has been signed with the corresponding private key for this public key.
Parameters:
message - Message, which was signed (usually plain text)
           (type=String)
signature - Signature, which was created for this message
           (type=String)
keyst - Public key - the corresponding private key must have been used for signing the message
           (type=String)
Returns:
True, if this message has produced exactly this signature if the corresponding private key was used, otherwise false
           (type=Boolean)

Instance Variable Details

_name

Name of the Implementation
Type:
String

Generated by Epydoc 2.0 on Sat Oct 22 22:52:46 2005 http://epydoc.sf.net