Package org.drasyl.identity
Class KeyAgreementSecretKey
java.lang.Object
org.drasyl.identity.KeyAgreementSecretKey
This class models a curve25519 private key that is used for x25519 key exchange.
This is an immutable object.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final short
static final short
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionintern()
static KeyAgreementSecretKey
of
(byte[] bytes) Converts a byte[] into aKeyAgreementSecretKey
.static KeyAgreementSecretKey
Converts aString
into aKeyAgreementSecretKey
.static KeyAgreementSecretKey
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
-
KeyAgreementSecretKey
public KeyAgreementSecretKey()
-
-
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
-
of
-
of
Converts a byte[] into aKeyAgreementSecretKey
.- Parameters:
bytes
- key as byte array- Returns:
IdentityPublicKey
-
of
Converts aString
into aKeyAgreementSecretKey
.- Parameters:
bytes
- keyAsHexString as String- Returns:
KeyAgreementSecretKey
- Throws:
IllegalArgumentException
- if string parameter does not conform to a valid keyAsHexString
-