Class PrivateKey
- java.lang.Object
-
- com.github.katenachain.crypto.AbstractKey
-
- com.github.katenachain.crypto.Nacl.PrivateKey
-
public class PrivateKey extends AbstractKey
PrivateKey is an X25519 private key wrapper (64 bytes).
-
-
Field Summary
-
Fields inherited from class com.github.katenachain.crypto.AbstractKey
key
-
-
Constructor Summary
Constructors Constructor Description PrivateKey(byte[] key)PrivateKey constructor with byte[].
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PublicKeygetPublicKey()byte[]open(byte[] encryptedMessage, PublicKey senderPublicKey, byte[] nonce)decrypts an encrypted message with the appropriate sender information.Hashtable<String,byte[]>seal(byte[] message, PublicKey recipientPublicKey)encrypts a plain text message decipherable afterwards by the recipient private key.-
Methods inherited from class com.github.katenachain.crypto.AbstractKey
getKey
-
-
-
-
Method Detail
-
seal
public Hashtable<String,byte[]> seal(byte[] message, PublicKey recipientPublicKey)
encrypts a plain text message decipherable afterwards by the recipient private key.- Parameters:
message-recipientPublicKey-- Returns:
-
open
public byte[] open(byte[] encryptedMessage, PublicKey senderPublicKey, byte[] nonce)decrypts an encrypted message with the appropriate sender information.- Parameters:
encryptedMessage-nonce-senderPublicKey-- Returns:
-
getPublicKey
public PublicKey getPublicKey()
- Returns:
-
-