Package org.conscrypt

Class XdhKeySpec

  • All Implemented Interfaces:
    java.security.spec.KeySpec

    public final class XdhKeySpec
    extends java.security.spec.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 Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.String getFormat()  
      byte[] getKey()
      Returns the public or private key in its raw format.
      int hashCode()  
      • Methods inherited from class java.security.spec.EncodedKeySpec

        getAlgorithm, getEncoded
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XdhKeySpec

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

      • getFormat

        public java.lang.String getFormat()
        Specified by:
        getFormat in class java.security.spec.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​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object