Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.crypto.key
Class BaseKeyAgreementParty  view BaseKeyAgreementParty download BaseKeyAgreementParty.java

java.lang.Object
  extended bygnu.javax.crypto.key.BaseKeyAgreementParty
All Implemented Interfaces:
IKeyAgreementParty

public abstract class BaseKeyAgreementParty
extends java.lang.Object
implements IKeyAgreementParty

A base abstract class to facilitate implementations of concrete key agreement protocol handlers.


Field Summary
protected  boolean complete
          Whether the exchange has concluded or not.
protected  boolean initialised
          Whether the instance is initialised or not.
protected  gnu.java.security.prng.IRandom irnd
          The optional gnu.java.security.prng.IRandom instance to use.
protected  java.lang.String name
          The canonical name of the protocol.
private  gnu.java.security.util.PRNG prng
          Our default source of randomness.
protected  java.security.SecureRandom rnd
          The optional java.security.SecureRandom instance to use.
protected  int step
          The current step index of the protocol exchange.
protected static java.math.BigInteger TWO
           
 
Constructor Summary
protected BaseKeyAgreementParty(java.lang.String name)
           
 
Method Summary
protected abstract  void engineInit(java.util.Map attributes)
           
protected abstract  OutgoingMessage engineProcessMessage(IncomingMessage in)
           
protected abstract  void engineReset()
           
protected abstract  byte[] engineSharedSecret()
           
private  gnu.java.security.util.PRNG getDefaultPRNG()
           
 byte[] getSharedSecret()
          Returns the byte array containing the shared secret as generated by this party.
 void init(java.util.Map attributes)
          Sets up the instance to operate with specific attributes.
 boolean isComplete()
          Returns true if the party in the key agreement protocol exchange has completed its part of the exchange.
 java.lang.String name()
          Returns the canonical name of the key agreement protocol.
protected  void nextRandomBytes(byte[] buffer)
          Fills the designated byte array with random data.
 OutgoingMessage processMessage(IncomingMessage in)
          Processes an incoming message at one end, generating a message that will be processed by the other party(ies).
 void reset()
          Resets this instance for re-use with another set of attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TWO

protected static final java.math.BigInteger TWO

name

protected java.lang.String name
The canonical name of the protocol.


initialised

protected boolean initialised
Whether the instance is initialised or not.


step

protected int step
The current step index of the protocol exchange.


complete

protected boolean complete
Whether the exchange has concluded or not.


rnd

protected java.security.SecureRandom rnd
The optional java.security.SecureRandom instance to use.


irnd

protected gnu.java.security.prng.IRandom irnd
The optional gnu.java.security.prng.IRandom instance to use.


prng

private gnu.java.security.util.PRNG prng
Our default source of randomness.

Constructor Detail

BaseKeyAgreementParty

protected BaseKeyAgreementParty(java.lang.String name)
Method Detail

name

public java.lang.String name()
Description copied from interface: IKeyAgreementParty

Returns the canonical name of the key agreement protocol.

Specified by:
name in interface IKeyAgreementParty

init

public void init(java.util.Map attributes)
          throws KeyAgreementException
Description copied from interface: IKeyAgreementParty

Sets up the instance to operate with specific attributes.

Specified by:
init in interface IKeyAgreementParty

processMessage

public OutgoingMessage processMessage(IncomingMessage in)
                               throws KeyAgreementException
Description copied from interface: IKeyAgreementParty

Processes an incoming message at one end, generating a message that will be processed by the other party(ies).

Specified by:
processMessage in interface IKeyAgreementParty

isComplete

public boolean isComplete()
Description copied from interface: IKeyAgreementParty

Returns true if the party in the key agreement protocol exchange has completed its part of the exchange. If this is the case an java.lang.IllegalStateException is thrown for any method invocation except init() or reset().

Specified by:
isComplete in interface IKeyAgreementParty

getSharedSecret

public byte[] getSharedSecret()
                       throws KeyAgreementException
Description copied from interface: IKeyAgreementParty

Returns the byte array containing the shared secret as generated by this party.

Specified by:
getSharedSecret in interface IKeyAgreementParty

reset

public void reset()
Description copied from interface: IKeyAgreementParty
Resets this instance for re-use with another set of attributes.

Specified by:
reset in interface IKeyAgreementParty

engineInit

protected abstract void engineInit(java.util.Map attributes)
                            throws KeyAgreementException

engineProcessMessage

protected abstract OutgoingMessage engineProcessMessage(IncomingMessage in)
                                                 throws KeyAgreementException

engineSharedSecret

protected abstract byte[] engineSharedSecret()
                                      throws KeyAgreementException

engineReset

protected abstract void engineReset()

nextRandomBytes

protected void nextRandomBytes(byte[] buffer)
Fills the designated byte array with random data.


getDefaultPRNG

private gnu.java.security.util.PRNG getDefaultPRNG()