Class XdhKeySpec

All Implemented Interfaces:
KeySpec

public final class XdhKeySpec extends EncodedKeySpec
External Diffie–Hellman key spec holding a key which could be either a public or private key.

Subclasses EncodedKeySpec using the non-Standard "raw" format. The XdhKeyFactory class utilises this in order to create XDH keys from raw bytes and to return them as an XdhKeySpec allowing the raw key material to be extracted from an XDH key.

  • Constructor Details

    • XdhKeySpec

      public XdhKeySpec(byte[] encoded)
      Creates an instance of XdhKeySpec by passing a public or private key in its raw format.
  • Method Details

    • getFormat

      public String getFormat()
      Specified by:
      getFormat in class EncodedKeySpec
    • getKey

      public byte[] getKey()
      Returns the public or private key in its raw format.
      Returns:
      key in its raw format.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object