Package org.drasyl.identity
Class IdentityPublicKey
java.lang.Object
java.net.SocketAddress
org.drasyl.identity.DrasylAddress
org.drasyl.identity.IdentityPublicKey
- All Implemented Interfaces:
Serializable,Key,PublicKey
This class models an ed25519 public key that is used as node's unique overlay address.
This is an immutable object.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortstatic final shortstatic final IdentityPublicKey -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintern()static IdentityPublicKeyof(byte[] bytes) Converts a byte[] into aIdentityPublicKey.static IdentityPublicKeyConverts aStringinto aIdentityPublicKey.static IdentityPublicKeyof(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:
-
ZERO_ID
-
-
Constructor Details
-
IdentityPublicKey
public IdentityPublicKey()
-
-
Method Details
-
getLongTimeKeyAgreementKey
- Returns:
- this public key as key agreement key (curve25519)
-
intern
-
toByteArray
public byte[] toByteArray()- Specified by:
toByteArrayin interfaceKey- Specified by:
toByteArrayin classDrasylAddress
-
toString
-
of
- Throws:
NullPointerException- ifbytesisnullIllegalArgumentException- ifbyteshas wrong key size
-
of
Converts a byte[] into aIdentityPublicKey.- Parameters:
bytes- public key- Returns:
IdentityPublicKey- Throws:
NullPointerException- ifkeyisnull
-
of
Converts aStringinto aIdentityPublicKey.- Parameters:
bytes- keyAsHexString as String- Returns:
IdentityPublicKey- Throws:
NullPointerException- ifkeyAsHexStringisnullIllegalArgumentException- ifkeyAsHexStringdoes not conform to a valid keyAsHexString string
-