nxt.crypto

## Class AnonymouslyEncryptedData

- java.lang.Object
- - nxt.crypto.AnonymouslyEncryptedData

-     public final class AnonymouslyEncryptedData
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnonymouslyEncryptedData(byte[] data, byte[] publicKey)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `decrypt(byte[] keySeed, byte[] theirPublicKey)`
    `byte[]` | `decrypt(java.lang.String secretPhrase)`
    `static AnonymouslyEncryptedData` | `encrypt(byte[] plaintext, java.lang.String secretPhrase, byte[] theirPublicKey, byte[] nonce)`
    `byte[]` | `getBytes()`
    `byte[]` | `getData()`
    `byte[]` | `getPublicKey()`
    `int` | `getSize()`
    `static AnonymouslyEncryptedData` | `readEncryptedData(byte[] bytes)`
    `static AnonymouslyEncryptedData` | `readEncryptedData(java.nio.ByteBuffer buffer, int length, int maxLength)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AnonymouslyEncryptedData

          public AnonymouslyEncryptedData(byte[] data,
                                          byte[] publicKey)

  - ### Method Detail

    - #### encrypt

          public static AnonymouslyEncryptedData encrypt(byte[] plaintext,
                                                         java.lang.String secretPhrase,
                                                         byte[] theirPublicKey,
                                                         byte[] nonce)

    - #### readEncryptedData

          public static AnonymouslyEncryptedData readEncryptedData(java.nio.ByteBuffer buffer,
                                                                   int length,
                                                                   int maxLength)
                                                            throws NxtException.NotValidException

      Throws:
        `NxtException.NotValidException`

    - #### readEncryptedData

          public static AnonymouslyEncryptedData readEncryptedData(byte[] bytes)

    - #### decrypt

          public byte[] decrypt(java.lang.String secretPhrase)

    - #### decrypt

          public byte[] decrypt(byte[] keySeed,
                                byte[] theirPublicKey)

    - #### getData

          public byte[] getData()

    - #### getPublicKey

          public byte[] getPublicKey()

    - #### getSize

          public int getSize()

    - #### getBytes

          public byte[] getBytes()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`