gnu.crypto.key
Class BaseKeyAgreementParty
- IKeyAgreementParty
public abstract class BaseKeyAgreementParty
A base abstract class to facilitate implementations of concrete key
agreement protocol handlers.
protected static BigInteger | TWO
|
protected boolean | complete - Whether the exchange has concluded or not.
|
protected boolean | initialised - Whether the instance is initialised or not.
|
protected IRandom | irnd - The optional
IRandom instance to use.
|
protected String | name - The canonical name of the protocol.
|
protected SecureRandom | rnd - The optional
SecureRandom instance to use.
|
protected int | step - The current step index of the protocol exchange.
|
TWO
protected static final BigInteger TWO
complete
protected boolean complete
Whether the exchange has concluded or not.
initialised
protected boolean initialised
Whether the instance is initialised or not.
name
protected String name
The canonical name of the protocol.
rnd
protected SecureRandom rnd
The optional SecureRandom
instance to use.
step
protected int step
The current step index of the protocol exchange.
BaseKeyAgreementParty
protected BaseKeyAgreementParty(String name)
engineReset
protected abstract void engineReset()
init
public void init(Map attributes)
throws KeyAgreementException
Sets up the instance to operate with specific attributes.
- init in interface IKeyAgreementParty
attributes
- a map of name-values used by concrete implementations.
isComplete
public boolean isComplete()
Returns true
if the party in the key agreement protocol
exchange has completed its part of the exchange. If this is the case an
IllegalStateException
is thrown for any method invocation except
init()
or reset()
.
- isComplete in interface IKeyAgreementParty
true
if this party has completed its part of the key
agreement protocol exchange; false
otherwise.
name
public String name()
Returns the canonical name of the key agreement protocol.
- name in interface IKeyAgreementParty
- the canonical name of the key agreement protocol.
nextRandomBytes
protected void nextRandomBytes(byte[] buffer)
Fills the designated byte array with random data.
buffer
- the byte array to fill with random data.
reset
public void reset()
Resets this instance for re-use with another set of attributes.
- reset in interface IKeyAgreementParty
Copyright © 2001, 2002, 2003
Free Software Foundation,
Inc. All Rights Reserved.