Added in API level 35

XdhKeySpec


class XdhKeySpec : EncodedKeySpec
kotlin.Any
   ↳ java.security.spec.EncodedKeySpec
   ↳ android.crypto.hpke.XdhKeySpec

External Diffie–Hellman (XDH) key spec holding 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.

Summary

Public constructors

Creates an instance of XdhKeySpec by passing a public or private key in its raw format.

Public methods
Boolean
equals(other: Any?)

String

Returns the name of the encoding format associated with this key specification.

ByteArray

Returns the public or private key in its raw format.

Int

Inherited functions

Public constructors

XdhKeySpec

Added in API level 35
XdhKeySpec(encoded: ByteArray)

Creates an instance of XdhKeySpec by passing a public or private key in its raw format.

Parameters
encoded ByteArray: This value cannot be null.

Public methods

equals

Added in API level 35
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getFormat

Added in API level 35
fun getFormat(): String

Returns the name of the encoding format associated with this key specification.

If the opaque representation of a key (see Key) can be transformed (see KeyFactory) into this key specification (or a subclass of it), getFormat called on the opaque key returns the same value as the getFormat method of this key specification.

Return
String This value cannot be null.

getKey

Added in API level 35
fun getKey(): ByteArray

Returns the public or private key in its raw format.

Return
ByteArray key in its raw format. This value cannot be null.

hashCode

Added in API level 35
fun hashCode(): Int
Return
Int a hash code value for this object.