org.minidns.record

## Class NSEC3

- java.lang.Object
- - org.minidns.record.Data
  - - org.minidns.record.NSEC3

-     public class NSEC3
      extends Data

  DNS NSEC3 (Next Secure 3) record payload for DNSSEC.
  Provides authenticated denial of existence with hashed names to prevent zone enumeration attacks.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `NSEC3.HashAlgorithm` DNSSEC NSEC3 Hash Algorithms.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static byte` | `FLAG_OPT_OUT` This Flag indicates whether this NSEC3 RR may cover unsigned delegations.
    `byte` | `flags` Bitmap of flags: `FLAG_OPT_OUT`.
    `NSEC3.HashAlgorithm` | `hashAlgorithm` The cryptographic hash algorithm used.
    `byte` | `hashAlgorithmByte` The byte value of the cryptographic hash algorithm used.
    `int` | `iterations` The number of iterations the hash algorithm is applied.
    `List<Record.TYPE>` | `types` The RR types existing at the original owner name.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NSEC3(byte hashAlgorithm, byte flags, int iterations, byte[] salt, byte[] nextHashed, List<Record.TYPE> types)`
    `NSEC3(byte hashAlgorithm, byte flags, int iterations, byte[] salt, byte[] nextHashed, Record.TYPE... types)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `copySaltInto(byte[] dest, int destPos)`
    `byte[]` | `getNextHashed()`
    `String` | `getNextHashedBase32()`
    `DnsLabel` | `getNextHashedDnsLabel()`
    `byte[]` | `getSalt()`
    `int` | `getSaltLength()`
    `Record.TYPE` | `getType()` The payload type.
    `static NSEC3` | `parse(DataInputStream dis, int length)`
    `void` | `serialize(DataOutputStream dos)` The internal method used to serialize Data subclasses.
    `String` | `toString()`

    - ### Methods inherited from class org.minidns.record.Data

      `equals, hashCode, length, toByteArray, toOutputStream, toOutputStream`

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

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

- - ### Field Detail

    - #### FLAG_OPT_OUT

          public static final byte FLAG_OPT_OUT

      This Flag indicates whether this NSEC3 RR may cover unsigned delegations.
      See Also:
        Constant Field Values

    - #### flags

          public final byte flags

      Bitmap of flags: `FLAG_OPT_OUT`.

    - #### hashAlgorithm

          public final NSEC3.HashAlgorithm hashAlgorithm

      The cryptographic hash algorithm used. If MiniDNS isn't aware of the hash algorithm, then this field will be `null`.
      See Also:
        `hashAlgorithmByte`

    - #### hashAlgorithmByte

          public final byte hashAlgorithmByte

      The byte value of the cryptographic hash algorithm used.

    - #### iterations

          public final int iterations

      The number of iterations the hash algorithm is applied.

    - #### types

          public final List<Record.TYPE> types

      The RR types existing at the original owner name.

  - ### Constructor Detail

    - #### NSEC3

          public NSEC3(byte hashAlgorithm,
                       byte flags,
                       int iterations,
                       byte[] salt,
                       byte[] nextHashed,
                       List<Record.TYPE> types)

    - #### NSEC3

          public NSEC3(byte hashAlgorithm,
                       byte flags,
                       int iterations,
                       byte[] salt,
                       byte[] nextHashed,
                       Record.TYPE... types)

  - ### Method Detail

    - #### copySaltInto

          public void copySaltInto(byte[] dest,
                                   int destPos)

    - #### getNextHashed

          public byte[] getNextHashed()

    - #### getNextHashedBase32

          public String getNextHashedBase32()

    - #### getNextHashedDnsLabel

          public DnsLabel getNextHashedDnsLabel()

    - #### getSalt

          public byte[] getSalt()

    - #### getSaltLength

          public int getSaltLength()

    - #### getType

          public Record.TYPE getType()

      Description copied from class: `Data`
      The payload type.
      Specified by:
        `getType` in class `Data`
      Returns:
        The payload type.

    - #### parse

          public static NSEC3 parse(DataInputStream dis,
                                    int length)
                             throws IOException

      Throws:
        `IOException`

    - #### serialize

          public void serialize(DataOutputStream dos)
                         throws IOException

      Description copied from class: `Data`
      The internal method used to serialize Data subclasses.
      Specified by:
        `serialize` in class `Data`
      Parameters:
        `dos` - the output stream to serialize to.
      Throws:
        `IOException` - if an I/O error occurs.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`