Package nxt.crypto
Class EncryptedData
- java.lang.Object
-
- nxt.crypto.EncryptedData
-
public final class EncryptedData extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static EncryptedData
EMPTY_DATA
-
Constructor Summary
Constructors Constructor Description EncryptedData(byte[] data, byte[] nonce)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
decrypt(java.lang.String secretPhrase, byte[] theirPublicKey)
static EncryptedData
encrypt(byte[] plaintext, java.lang.String secretPhrase, byte[] theirPublicKey)
byte[]
getBytes()
byte[]
getData()
static int
getEncryptedDataLength(byte[] plaintext)
static int
getEncryptedSize(byte[] plaintext)
byte[]
getNonce()
int
getSize()
static EncryptedData
readEncryptedData(byte[] bytes)
static EncryptedData
readEncryptedData(java.nio.ByteBuffer buffer, int length, int maxLength)
java.lang.String
toString()
-
-
-
Field Detail
-
EMPTY_DATA
public static final EncryptedData EMPTY_DATA
-
-
Method Detail
-
encrypt
public static EncryptedData encrypt(byte[] plaintext, java.lang.String secretPhrase, byte[] theirPublicKey)
-
readEncryptedData
public static EncryptedData readEncryptedData(java.nio.ByteBuffer buffer, int length, int maxLength) throws NxtException.NotValidException
- Throws:
NxtException.NotValidException
-
readEncryptedData
public static EncryptedData readEncryptedData(byte[] bytes)
-
getEncryptedDataLength
public static int getEncryptedDataLength(byte[] plaintext)
-
getEncryptedSize
public static int getEncryptedSize(byte[] plaintext)
-
decrypt
public byte[] decrypt(java.lang.String secretPhrase, byte[] theirPublicKey)
-
getData
public byte[] getData()
-
getNonce
public byte[] getNonce()
-
getSize
public int getSize()
-
getBytes
public byte[] getBytes()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-