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 EncryptedDataEMPTY_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 EncryptedDataencrypt(byte[] plaintext, java.lang.String secretPhrase, byte[] theirPublicKey)byte[]getBytes()byte[]getData()static intgetEncryptedDataLength(byte[] plaintext)static intgetEncryptedSize(byte[] plaintext)byte[]getNonce()intgetSize()static EncryptedDatareadEncryptedData(byte[] bytes)static EncryptedDatareadEncryptedData(java.nio.ByteBuffer buffer, int length, int maxLength)java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
-