com.mindbright.jce.crypto
Class KeyAgreement

java.lang.Object
  extended by com.mindbright.jce.crypto.KeyAgreement

public class KeyAgreement
extends java.lang.Object


Field Summary
protected  KeyAgreementSpi keyAgreementSpi
           
 
Constructor Summary
protected KeyAgreement(KeyAgreementSpi keyAgreeSpi, Provider provider, java.lang.String algorithm)
           
 
Method Summary
 Key doPhase(Key key, boolean lastPhase)
           
 byte[] generateSecret()
           
 int generateSecret(byte[] sharedSecret, int offset)
           
 SecretKey generateSecret(java.lang.String algorithm)
           
 java.lang.String getAlgorithm()
           
static KeyAgreement getInstance(java.lang.String algorithm)
           
static KeyAgreement getInstance(java.lang.String algorithm, java.lang.String provider)
           
 Provider getProvider()
           
 void init(Key key)
           
 void init(Key key, AlgorithmParameterSpec params)
           
 void init(Key key, AlgorithmParameterSpec params, SecureRandom random)
           
 void init(Key key, SecureRandom random)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyAgreementSpi

protected KeyAgreementSpi keyAgreementSpi
Constructor Detail

KeyAgreement

protected KeyAgreement(KeyAgreementSpi keyAgreeSpi,
                       Provider provider,
                       java.lang.String algorithm)
Method Detail

getAlgorithm

public final java.lang.String getAlgorithm()

getInstance

public static final KeyAgreement getInstance(java.lang.String algorithm)
                                      throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

getInstance

public static final KeyAgreement getInstance(java.lang.String algorithm,
                                             java.lang.String provider)
                                      throws NoSuchAlgorithmException,
                                             NoSuchProviderException
Throws:
NoSuchAlgorithmException
NoSuchProviderException

getProvider

public final Provider getProvider()

init

public final void init(Key key)
                throws InvalidKeyException
Throws:
InvalidKeyException

init

public final void init(Key key,
                       SecureRandom random)
                throws InvalidKeyException
Throws:
InvalidKeyException

init

public final void init(Key key,
                       AlgorithmParameterSpec params)
                throws InvalidKeyException,
                       InvalidAlgorithmParameterException
Throws:
InvalidKeyException
InvalidAlgorithmParameterException

init

public final void init(Key key,
                       AlgorithmParameterSpec params,
                       SecureRandom random)
                throws InvalidKeyException,
                       InvalidAlgorithmParameterException
Throws:
InvalidKeyException
InvalidAlgorithmParameterException

doPhase

public final Key doPhase(Key key,
                         boolean lastPhase)
                  throws InvalidKeyException,
                         java.lang.IllegalStateException
Throws:
InvalidKeyException
java.lang.IllegalStateException

generateSecret

public final byte[] generateSecret()
                            throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

generateSecret

public final int generateSecret(byte[] sharedSecret,
                                int offset)
                         throws java.lang.IllegalStateException,
                                ShortBufferException
Throws:
java.lang.IllegalStateException
ShortBufferException

generateSecret

public final SecretKey generateSecret(java.lang.String algorithm)
                               throws java.lang.IllegalStateException,
                                      NoSuchAlgorithmException,
                                      InvalidKeyException
Throws:
java.lang.IllegalStateException
NoSuchAlgorithmException
InvalidKeyException