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
FieldsModifier and TypeFieldDescriptionstatic final shortstatic final short -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintern()static KeyAgreementPublicKeyof(byte[] bytes) Converts a byte[] into aKeyAgreementPublicKey.static KeyAgreementPublicKeyConverts aStringinto aKeyAgreementPublicKey.static KeyAgreementPublicKeyof(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:
toByteArrayin interfaceKey
-
toString
-
of
-
of
Converts a byte[] into aKeyAgreementPublicKey.- Parameters:
bytes- public key- Returns:
KeyAgreementPublicKey- Throws:
NullPointerException- ifkeyisnull
-
of
Converts aStringinto aKeyAgreementPublicKey.- Parameters:
bytes- keyAsHexString as String- Returns:
KeyAgreementPublicKey- Throws:
NullPointerException- ifkeyAsHexStringisnullIllegalArgumentException- ifkeyAsHexStringdoes not conform to a valid keyAsHexString string
-