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[].PrivateKey(String privateKeyBase64)PrivateKey constructor with base64 String.
-
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
-
-
-
-
Constructor Detail
-
PrivateKey
public PrivateKey(byte[] key)
PrivateKey constructor with byte[].
-
PrivateKey
public PrivateKey(String privateKeyBase64)
PrivateKey constructor with base64 String.
-
-
Method Detail
-
seal
public Hashtable<String,byte[]> seal(byte[] message, PublicKey recipientPublicKey)
encrypts a plain text message decipherable afterwards by the recipient private key.
-
open
public byte[] open(byte[] encryptedMessage, PublicKey senderPublicKey, byte[] nonce)decrypts an encrypted message with the appropriate sender information.
-
getPublicKey
public PublicKey getPublicKey()
-
-