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
FieldsModifier and TypeFieldDescriptionstatic final shortstatic final short -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintern()static KeyAgreementSecretKeyof(byte[] bytes) Converts a byte[] into aKeyAgreementSecretKey.static KeyAgreementSecretKeyConverts aStringinto aKeyAgreementSecretKey.static KeyAgreementSecretKeyof(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: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
-
of
-
of
Converts a byte[] into aKeyAgreementSecretKey.- Parameters:
bytes- key as byte array- Returns:
IdentityPublicKey
-
of
Converts aStringinto aKeyAgreementSecretKey.- Parameters:
bytes- keyAsHexString as String- Returns:
KeyAgreementSecretKey- Throws:
IllegalArgumentException- if string parameter does not conform to a valid keyAsHexString
-