Class HybridValueParameterSpec

java.lang.Object
org.bouncycastle.jcajce.spec.HybridValueParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec, Destroyable

public class HybridValueParameterSpec extends Object implements AlgorithmParameterSpec, Destroyable
SP 800-56C Hybrid Value spec, by default to allow the secret in a key agreement to be created as "Z | T" where T is some other secret value as described in Section 2. If the value doPrepend is set to true the spec will be used to calculate "T | Z" instead.

Get methods throw IllegalStateException if destroy() is called.

  • Constructor Details

    • HybridValueParameterSpec

      public HybridValueParameterSpec(byte[] t, AlgorithmParameterSpec baseSpec)
      Create a spec with T set to t and the spec for the KDF in the agreement to baseSpec. Note: the t value is not copied.
      Parameters:
      t - a shared secret to be concatenated with the agreement's Z value.
      baseSpec - the base spec for the agreements KDF.
    • HybridValueParameterSpec

      public HybridValueParameterSpec(byte[] t, boolean doPrepend, AlgorithmParameterSpec baseSpec)
      Create a spec with T set to t and the spec for the KDF in the agreement to baseSpec. Note: the t value is not copied.
      Parameters:
      t - a shared secret to be concatenated with the agreement's Z value.
      baseSpec - the base spec for the agreements KDF.
  • Method Details

    • isPrependedT

      public boolean isPrependedT()
      Return whether or not T should be prepended.
      Returns:
      true if T to be prepended, false otherwise.
    • getT

      public byte[] getT()
      Return a reference to the T value.
      Returns:
      a reference to T.
    • getBaseParameterSpec

      public AlgorithmParameterSpec getBaseParameterSpec()
      Return the base parameter spec.
      Returns:
      base spec to be applied to the KDF.
    • isDestroyed

      public boolean isDestroyed()
      Return true if the destroy() method is called and the contents are erased.
      Specified by:
      isDestroyed in interface Destroyable
      Returns:
      true if destroyed, false otherwise.
    • destroy

      public void destroy()
      Destroy this parameter spec, explicitly erasing its contents.
      Specified by:
      destroy in interface Destroyable