Class SecretKeyWithEncapsulation

java.lang.Object
org.bouncycastle.jcajce.SecretKeyWithEncapsulation
All Implemented Interfaces:
Serializable, Key, SecretKey, Destroyable

public final class SecretKeyWithEncapsulation extends Object implements SecretKey
Carrier class for a KEM/KTS secret key plus its encapsulation.
See Also:
  • Constructor Details

    • SecretKeyWithEncapsulation

      public SecretKeyWithEncapsulation(SecretKey secretKey, byte[] encapsulation)
      Basic constructor.
      Parameters:
      secretKey - the secret key that was arrived at.
      encapsulation - the encapsulation the key data was carried in.
  • Method Details

    • getAlgorithm

      public String getAlgorithm()
      Return the algorithm for the agreed secret key.
      Specified by:
      getAlgorithm in interface Key
      Returns:
      the secret key value.
    • getFormat

      public String getFormat()
      Return the format for the agreed secret key.
      Specified by:
      getFormat in interface Key
      Returns:
      the secret key format.
    • getEncoded

      public byte[] getEncoded()
      Return the encoding of the agreed secret key.
      Specified by:
      getEncoded in interface Key
      Returns:
      the secret key encoding.
    • getEncapsulation

      public byte[] getEncapsulation()
      Return the encapsulation that carried the key material used in creating the agreed secret key.
      Returns:
      the encrypted encapsulation of the agreed secret key.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object