All Packages Class Hierarchy This Package Previous Next Index
Class semper.statement.StatementTransaction
java.lang.Object
|
+----semper.statement.StatementTransaction
- public class StatementTransaction
- extends Object
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.21 $ $Date: 1998/06/15 14:56:40 $
- Author:
- Jesper Drud Nielsen ([email protected])
- See Also:
- openInitiatorStatementSession, openResponderStatementSession
-
StatementTransaction(AlgorithmContext, SessionKey, CertificateContext, CertificateContext)
- creates a new StatementTransaction object.
-
decipher(Statement)
- Decipher an enciphered statement.
-
encipher(Statement)
- Encipher a statement.
-
generateMAC(Statement)
- Generate a (keyed) MAC value on a statement object.
-
generateSignature(Statement)
- Sign a statement.
-
getRecipient(Statement)
- Retrieve the information stored in the statement about the recipient.
-
getSender(Statement)
- Get the information stored in the Statement about the sender.
-
pkDecipher(Statement)
- Decipher a pkEnciphered statement object using the secret (asymmetric) key for
decryption.
-
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.
-
printContents()
-
-
setRecipient(Statement)
- Set information about the intended the recipient.
-
setSender(Statement)
- Identifies the sender of the Statement according to information Certificate Context of
the transaction object.
-
setYourContext(CertificateContext)
-
-
verifyMAC(Statement)
- Verify a (keyed) MAC value on a statement object.
-
verifySignature(Statement)
- Verify the signature in a signed statement.
StatementTransaction
public StatementTransaction(AlgorithmContext algorithmContext,
SessionKey sessionKey,
CertificateContext myContext,
CertificateContext yourContext)
- 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:
- algorithmContext - specifies the algorithsm to be used
- myContext - contains my own certificate context
- yourContext - contains the certificate context of the peer
- See Also:
- Statement
encipher
public void 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
decipher
public void 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
generateSignature
public void 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
verifySignature
public boolean verifySignature(Statement s) throws StatementManException
- Verify the signature in a signed statement.
The signature is verified using pkSignaturePartner
- Parameters:
- s - the statement on which to operate
- Returns:
- true if the signature is ok and false otherwise
- Throws: StatementManException
- if the process fails
- See Also:
- verifySignature, generateSignature
generateMAC
public void generateMAC(Statement s) 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
verifyMAC
public boolean 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:
- true if the MAC is OK and false otherwise
- Throws: StatementManException
- if the process fails
- See Also:
- verifyMAC, generateMAC
pkEncipher
public void 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
pkDecipher
public void 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
setSender
public void setSender(Statement s)
- Identifies the sender of the Statement according to information Certificate Context of
the transaction object.
- Parameters:
- s - the statement on which to operate
- See Also:
- getSender
getSender
public String getSender(Statement s)
- Get the information stored in the Statement about the sender.
- Parameters:
- s - the statement on which to operate
- Returns:
- the sender identification
- See Also:
- setSender
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
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
setYourContext
public void setYourContext(CertificateContext yourContext)
printContents
public void printContents()
All Packages Class Hierarchy This Package Previous Next Index