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
Modifier and TypeFieldDescriptionstatic final short
static final short
static final IdentityPublicKey
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
intern()
static IdentityPublicKey
of
(byte[] bytes) Converts a byte[] into aIdentityPublicKey
.static IdentityPublicKey
Converts aString
into aIdentityPublicKey
.static IdentityPublicKey
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:
-
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:
toByteArray
in interfaceKey
- Specified by:
toByteArray
in classDrasylAddress
-
toString
-
hashCode
public int hashCode() -
equals
-
of
- Throws:
NullPointerException
- ifbytes
isnull
IllegalArgumentException
- ifbytes
has wrong key size
-
of
Converts a byte[] into aIdentityPublicKey
.- Parameters:
bytes
- public key- Returns:
IdentityPublicKey
- Throws:
NullPointerException
- ifkey
isnull
IllegalArgumentException
- ifbytes
has wrong key size
-
of
Converts aString
into aIdentityPublicKey
.- Parameters:
bytes
- keyAsHexString as String- Returns:
IdentityPublicKey
- Throws:
NullPointerException
- ifkeyAsHexString
isnull
IllegalArgumentException
- ifkeyAsHexString
does not conform to a valid keyAsHexString string
-