Package org.drasyl.identity
Class KeyAgreementPublicKey
java.lang.Object
org.drasyl.identity.KeyAgreementPublicKey
This class models a curve25519 public key that is used for x25519 key exchange.
This is an immutable object.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final short
static final short
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionintern()
static KeyAgreementPublicKey
of
(byte[] bytes) Converts a byte[] into aKeyAgreementPublicKey
.static KeyAgreementPublicKey
Converts aString
into aKeyAgreementPublicKey
.static KeyAgreementPublicKey
of
(ImmutableByteArray bytes) byte[]
toString()
-
Field Details
-
KEY_LENGTH_AS_BYTES
public static final short KEY_LENGTH_AS_BYTES- See Also:
-
KEY_LENGTH_AS_STRING
public static final short KEY_LENGTH_AS_STRING- See Also:
-
-
Constructor Details
-
KeyAgreementPublicKey
public KeyAgreementPublicKey()
-
-
Method Details
-
intern
-
toByteArray
public byte[] toByteArray()- Specified by:
toByteArray
in interfaceKey
-
toString
-
of
-
of
Converts a byte[] into aKeyAgreementPublicKey
.- Parameters:
bytes
- public key- Returns:
KeyAgreementPublicKey
- Throws:
NullPointerException
- ifkey
isnull
-
of
Converts aString
into aKeyAgreementPublicKey
.- Parameters:
bytes
- keyAsHexString as String- Returns:
KeyAgreementPublicKey
- Throws:
NullPointerException
- ifkeyAsHexString
isnull
IllegalArgumentException
- ifkeyAsHexString
does not conform to a valid keyAsHexString string
-