Class semper.statement.StatementTransaction
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.statement.StatementTransaction

java.lang.Object
   |
   +----semper.statement.StatementTransaction

public class StatementTransaction
extends Object
implements StatementConstants, CryptoConstants
Provides statement operations using algorithms and keys negotiated with a second part. Thus, using this class is appropriate each time a number of operations should be grouped together in a session. A StatementTransaction object should only be constructed by the StatementManager. and this should be done whenever two parties want to do just send information to each other more than once. Furhtermore, for some functions requirering shared conventional keys, this may be the only way to use such service (the only exception being if the two parties shre a key a priori. A transaction object contains (a subset of) the following information about the session: the identities of the two parties, shared conventional keys needed for encryption and MAC, certificate on my public key used to verify my signatures. certificate on my public key used to encryption, certificate on patner public key used to verify partner signatures, certificate on my public key used to encryption, my secret signature key, my secret decryption key, the public key of the counterpart for signature verification, public encryption key of counterpart, the negotiated hash algorithm, the negotiated MAC algorithm, the method for encrypting a conventional key under an asymmetric public key.
Version:
$Revision: 1.13 $ $Date: 1997/01/28 10:07:51 $
Author:
Jesper Drud Nielsen (drud@cryptomathic.aau.dk)
See Also:
openInitiatorStatementSession, openResponderStatementSession

Constructor Index

 o StatementTransaction(String, String, CryptoKeyInfo, CryptoKeyInfo, Certificate, Certificate, Certificate, Certificate, CryptoKeyInfo, CryptoKeyInfo, CryptoKeyInfo, CryptoKeyInfo, int, int, int)
creates a new StatementTransaction object.

Method Index

 o decipher(Statement)
Decipher an enciphered statement.
 o encipher(Statement)
Encipher a statement.
 o generateMAC(Statement, Date)
Generate a (keyed) MAC value on a statement object.
 o generateSignature(Statement)
Sign a statement.
 o getRecipient(Statement)
Retrieve the information stored in the statement about the recipient.
 o getSender(Statement)
Get the information stored in the Statement about the sender.
 o myStreamSize(StreamOutputInterface)
Returns the size of the StatementTransaction object when externalized.
 o pkDecipher(Statement)
Decipher a pkEnciphered statement object using the secret (asymmetric) key for decryption.
 o pkEncipher(Statement)
Encipher a statement object under a random conventional key (same algorithm as the session key for encryption), and encrypt this key under the public encryption key defined in this transaction object.
 o readObject(StreamInputInterface)
Internalizes a StatementTransaction object.
 o setRecipient(Statement)
Set information about the intended the recipient.
 o setSender(Statement)
Identifies the sender of the Statement according to information in the transaction object.
 o verifyMAC(Statement)
Verify a (keyed) MAC value on a statement object.
 o verifySignature(Statement, Date, Date)
Verify the signature in a signed statement.
 o writeObject(StreamOutputInterface)
Externalizes a StatementTransaction object.

Constructors

 o StatementTransaction
  public StatementTransaction(String newSenderId,
                              String newRecipientId,
                              CryptoKeyInfo newSessionKeyEnc,
                              CryptoKeyInfo newSessionKeyMAC,
                              Certificate newSignatureCertificateOwn,
                              Certificate newCipherCertificateOwn,
                              Certificate newSignatureCertificatePartner,
                              Certificate newCipherCertificatePartner,
                              CryptoKeyInfo newSKSignatureOwn,
                              CryptoKeyInfo newSKCipherOwn,
                              CryptoKeyInfo newPkSignaturePartner,
                              CryptoKeyInfo newPkCipherPartner,
                              int newHashAlg,
                              int newMACalg,
                              int newKeyEncryption)
creates a new StatementTransaction object. The StatementTransaction object may be used in case multiple consecutive operation are to be performed on the same Statement object. The StatementTransaction will contain a user defined context to be used for each operation on the Statement (sender identification, recipient identification, MAC verification key etc).
Parameters:
newSenderId - sender identification
newRecipientId - recipient identification
newSessionKeyEnc - new session key for encryption
newSessionKeyMAC - new session key for MAC
newSignatureCertificateOwn - users own certificate on public signature verification key
newCipherCertificateOwn - users own certificate on public encryption key
newSignatureCipherPartner - partners certificate on public signature verification key
newCipherCertificatePartner - partners certificate on public encryption key
newSkSignatureOwn - secret key used to make signatures
newSkCipherOwn - secret key used for public key decryption
newPkSignaturePartner - public key to use when verifyin a signature
newPkCipherPartner - public key to use when pkEncrypting a statement
newHashAlg - designates the hash algorithm to be used in this session
newMACalg - designates the MAC algorithm to be used
newKeyEncryption - is the preferred mode of padding when encrypting conv. keys
See Also:
Statement

Methods

 o encipher
  public int encipher(Statement s) throws StatementManException
Encipher a statement. The statement is enciphered using the conventional key for encryption.
Parameters:
s - the statement to be enciphered
Throws: StatementManException
if the encryption fails
See Also:
encipher
 o decipher
  public int decipher(Statement s) throws StatementManException
Decipher an enciphered statement. The statement is deiphered. If a conventinal key for this has been negotiated, this key is used. Otherwise a key designated by the Statement is used..
Parameters:
s - the statement on which to operate
Throws: StatementManException
if the decryption fails
See Also:
decipher
 o generateSignature
  public int generateSignature(Statement s) throws StatementManException
Sign a statement. Signs the statement using private signature key and the hash algorithm. No certificate is added to the statement.
Parameters:
s - the statement on which to operate
Throws: StatementManException
if signing fails
See Also:
generateSignature, verifySignature
 o verifySignature
  public int verifySignature(Statement s,
                             Date timewindowstart,
                             Date timewindowend) throws StatementManException
Verify the signature in a signed statement. The signature is verified using pkSignaturePartner
Parameters:
s - the statement on which to operate
timewindowstart - the signature must not have been generated before this time
timewindowend - the signature must not have been generated after this time
Returns:
0 if the signature is ok and 1 otherwise
Throws: StatementManException
if the process fails
See Also:
verifySignature, generateSignature
 o generateMAC
  public int generateMAC(Statement s,
                         Date date) throws StatementManException
Generate a (keyed) MAC value on a statement object. The MAC value is generated using session key for this defined by the transaction object.
Parameters:
s - the statement on which to operate
Throws: StatementManException
if the process fails
See Also:
generateMAC, verifyMAC
 o verifyMAC
  public int verifyMAC(Statement s) throws StatementManException
Verify a (keyed) MAC value on a statement object. The MAC value is verified using session key. If no such key is defined the method will try to identify a key from the Statement and use that key.
Parameters:
s - the statement on which to operate
Returns:
0 if the MAC is OK and 1 otherwise
Throws: StatementManException
if the process fails
See Also:
verifyMAC, generateMAC
 o pkEncipher
  public int pkEncipher(Statement s) throws StatementManException
Encipher a statement object under a random conventional key (same algorithm as the session key for encryption), and encrypt this key under the public encryption key defined in this transaction object.
Parameters:
s - the statement on which to operate
Throws: StatementManException
if the encryption fails
See Also:
pkDecipher, pkEncipher
 o pkDecipher
  public int pkDecipher(Statement s) throws StatementManException
Decipher a pkEnciphered statement object using the secret (asymmetric) key for decryption.
Parameters:
s - the statement on which to operate
Throws: StatementManException
if the Statement could not be deciphered
See Also:
pkDecipher, pkEncipher
 o setSender
  public void setSender(Statement s)
Identifies the sender of the Statement according to information in the transaction object. A null string clears the sender.
Parameters:
s - the statement on which to operate
See Also:
getSender
 o getSender
  public String getSender(Statement s)
Get the information stored in the Statement about the sender. A null string means "no sender".
Parameters:
s - the statement on which to operate
Returns:
the sender identification
See Also:
setSender
 o setRecipient
  public void setRecipient(Statement s)
Set information about the intended the recipient. A null string clears the possibly existing information about the recipient.
Parameters:
s - the statement on which to operate
See Also:
getRecipient
 o getRecipient
  public String getRecipient(Statement s)
Retrieve the information stored in the statement about the recipient. A null string means that the statement contains no information about the recipient.
Parameters:
s - the statement on which to operate
Returns:
the recipient identification
See Also:
setRecipient
 o writeObject
  public void writeObject(StreamOutputInterface s) throws StreamIOException
Externalizes a StatementTransaction object. By calling this method a StatementTransaction will be written to the IO stream.
Parameters:
s - is the StreamOutputInterface onto which the object is written
Returns:
no return value
Throws: IOException
If the output data is corrupt.
 o readObject
  public void readObject(StreamInputInterface s) throws StreamIOException
Internalizes a StatementTransaction object. By calling this method a StatementTransaction will be read from the IO stream.
Parameters:
s - is the StreamOutputInterface from which the object is read
Returns:
no return value
Throws: IOException
If the input data is corrupt.
See Also:
readObject
 o myStreamSize
  public int myStreamSize(StreamOutputInterface s) throws StreamIOException
Returns the size of the StatementTransaction object when externalized.
Parameters:
s - is the StreamOutputInterface relative to which the size is computed
Returns:
Size of externalized object
Throws: IOException
if the size could not be computed

All Packages  Class Hierarchy  This Package  Previous  Next  Index