Package org.drasyl.identity
Class IdentitySecretKey
java.lang.Object
org.drasyl.identity.IdentitySecretKey
This class models a ed25519 private key.
This is an immutable object.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final short
static final short
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDerives theIdentityPublicKey
from this secret key.intern()
static IdentitySecretKey
of
(byte[] bytes) Converts a byte[] into aIdentitySecretKey
.static IdentitySecretKey
Converts aString
into aIdentitySecretKey
.static IdentitySecretKey
of
(ImmutableByteArray bytes) byte[]
toString()
UnlikeObject.toString()
, this method returns an unmasked secret key.
-
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
-
IdentitySecretKey
public IdentitySecretKey()
-
-
Method Details
-
intern
-
toString
-
toUnmaskedString
Description copied from interface:SecretKey
UnlikeObject.toString()
, this method returns an unmasked secret key.- Specified by:
toUnmaskedString
in interfaceSecretKey
- Returns:
- unmasked string representation of the secret key
-
toByteArray
public byte[] toByteArray()- Specified by:
toByteArray
in interfaceKey
-
derivePublicKey
Derives theIdentityPublicKey
from this secret key.- Returns:
IdentityPublicKey
dervied from this secret key.
-
of
-
of
Converts a byte[] into aIdentitySecretKey
.- Parameters:
bytes
- key as byte array- Returns:
IdentityPublicKey
-
of
Converts aString
into aIdentitySecretKey
.- Parameters:
bytes
- keyAsHexString as String- Returns:
IdentitySecretKey
- Throws:
IllegalArgumentException
- if string parameter does not conform to a valid keyAsHexString
-