BaseAgreementSpi (Bouncy Castle Library 1.54 API Specification)
Date: 2015-12-29

org.bouncycastle.jcajce.provider.asymmetric.util

## Class BaseAgreementSpi

- java.lang.Object
- - javax.crypto.KeyAgreementSpi
  - - org.bouncycastle.jcajce.provider.asymmetric.util.BaseAgreementSpi

- Direct Known Subclasses:
    KeyAgreementSpi, KeyAgreementSpi

      public abstract class BaseAgreementSpi
      extends javax.crypto.KeyAgreementSpi

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.math.BigInteger` | `result`
    `protected byte[]` | `ukmParameters`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseAgreementSpi(java.lang.String kaAlgorithm, DerivationFunction kdf)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract byte[]` | `bigIntToBytes(java.math.BigInteger result)`
    `protected byte[]` | `engineGenerateSecret()`
    `protected int` | `engineGenerateSecret(byte[] sharedSecret, int offset)`
    `protected javax.crypto.SecretKey` | `engineGenerateSecret(java.lang.String algorithm)`
    `protected static java.lang.String` | `getAlgorithm(java.lang.String algDetails)`
    `protected static int` | `getKeySize(java.lang.String algDetails)`
    `protected static byte[]` | `trimZeroes(byte[] secret)`

    - ### Methods inherited from class javax.crypto.KeyAgreementSpi

      `engineDoPhase, engineInit, engineInit`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### result

          protected java.math.BigInteger result

    - #### ukmParameters

          protected byte[] ukmParameters

  - ### Constructor Detail

    - #### BaseAgreementSpi

          public BaseAgreementSpi(java.lang.String kaAlgorithm,
                          DerivationFunction kdf)

  - ### Method Detail

    - #### getAlgorithm

          protected static java.lang.String getAlgorithm(java.lang.String algDetails)

    - #### getKeySize

          protected static int getKeySize(java.lang.String algDetails)

    - #### trimZeroes

          protected static byte[] trimZeroes(byte[] secret)

    - #### 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`

    - #### bigIntToBytes

          protected abstract byte[] bigIntToBytes(java.math.BigInteger result)