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
FieldsModifier and TypeFieldDescriptionstatic final shortstatic final short -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDerives theIdentityPublicKeyfrom this secret key.intern()static IdentitySecretKeyof(byte[] bytes) Converts a byte[] into aIdentitySecretKey.static IdentitySecretKeyConverts aStringinto aIdentitySecretKey.static IdentitySecretKeyof(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:SecretKeyUnlikeObject.toString(), this method returns an unmasked secret key.- Specified by:
toUnmaskedStringin interfaceSecretKey- Returns:
- unmasked string representation of the secret key
-
toByteArray
public byte[] toByteArray()- Specified by:
toByteArrayin interfaceKey
-
derivePublicKey
Derives theIdentityPublicKeyfrom this secret key.- Returns:
IdentityPublicKeydervied from this secret key.
-
of
-
of
Converts a byte[] into aIdentitySecretKey.- Parameters:
bytes- key as byte array- Returns:
IdentityPublicKey
-
of
Converts aStringinto aIdentitySecretKey.- Parameters:
bytes- keyAsHexString as String- Returns:
IdentitySecretKey- Throws:
IllegalArgumentException- if string parameter does not conform to a valid keyAsHexString
-