Bouncy Castle Cryptography 1.50

org.bouncycastle.jcajce.provider.asymmetric.ec
Class KeyAgreementSpi

java.lang.Object
  extended by javax.crypto.KeyAgreementSpi
      extended by org.bouncycastle.jcajce.provider.asymmetric.ec.KeyAgreementSpi
Direct Known Subclasses:
KeyAgreementSpi.DH, KeyAgreementSpi.DHC, KeyAgreementSpi.DHwithSHA1KDF, KeyAgreementSpi.MQV, KeyAgreementSpi.MQVwithSHA1KDF

public class KeyAgreementSpi
extends javax.crypto.KeyAgreementSpi

Diffie-Hellman key agreement using elliptic curve keys, ala IEEE P1363 both the simple one, and the simple one with cofactors are supported. Also, MQV key agreement per SEC-1


Nested Class Summary
static class KeyAgreementSpi.DH
           
static class KeyAgreementSpi.DHC
           
static class KeyAgreementSpi.DHwithSHA1KDF
           
static class KeyAgreementSpi.MQV
           
static class KeyAgreementSpi.MQVwithSHA1KDF
           
 
Constructor Summary
protected KeyAgreementSpi(java.lang.String kaAlgorithm, BasicAgreement agreement, DerivationFunction kdf)
           
 
Method Summary
protected  java.security.Key engineDoPhase(java.security.Key key, boolean lastPhase)
           
protected  byte[] engineGenerateSecret()
           
protected  int engineGenerateSecret(byte[] sharedSecret, int offset)
           
protected  javax.crypto.SecretKey engineGenerateSecret(java.lang.String algorithm)
           
protected  void engineInit(java.security.Key key, java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
           
protected  void engineInit(java.security.Key key, java.security.SecureRandom random)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyAgreementSpi

protected KeyAgreementSpi(java.lang.String kaAlgorithm,
                          BasicAgreement agreement,
                          DerivationFunction kdf)
Method Detail

engineDoPhase

protected java.security.Key engineDoPhase(java.security.Key key,
                                          boolean lastPhase)
                                   throws java.security.InvalidKeyException,
                                          java.lang.IllegalStateException
Specified by:
engineDoPhase in class javax.crypto.KeyAgreementSpi
Throws:
java.security.InvalidKeyException
java.lang.IllegalStateException

engineGenerateSecret

protected byte[] engineGenerateSecret()
                               throws java.lang.IllegalStateException
Specified by:
engineGenerateSecret in class javax.crypto.KeyAgreementSpi
Throws:
java.lang.IllegalStateException

engineGenerateSecret

protected int engineGenerateSecret(byte[] sharedSecret,
                                   int offset)
                            throws java.lang.IllegalStateException,
                                   javax.crypto.ShortBufferException
Specified by:
engineGenerateSecret in class javax.crypto.KeyAgreementSpi
Throws:
java.lang.IllegalStateException
javax.crypto.ShortBufferException

engineGenerateSecret

protected javax.crypto.SecretKey engineGenerateSecret(java.lang.String algorithm)
                                               throws java.security.NoSuchAlgorithmException
Specified by:
engineGenerateSecret in class javax.crypto.KeyAgreementSpi
Throws:
java.security.NoSuchAlgorithmException

engineInit

protected void engineInit(java.security.Key key,
                          java.security.spec.AlgorithmParameterSpec params,
                          java.security.SecureRandom random)
                   throws java.security.InvalidKeyException,
                          java.security.InvalidAlgorithmParameterException
Specified by:
engineInit in class javax.crypto.KeyAgreementSpi
Throws:
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

engineInit

protected void engineInit(java.security.Key key,
                          java.security.SecureRandom random)
                   throws java.security.InvalidKeyException
Specified by:
engineInit in class javax.crypto.KeyAgreementSpi
Throws:
java.security.InvalidKeyException

Bouncy Castle Cryptography 1.50