TKEYRecord (dnsjava documentation)
Date: 2013-04-10

org.xbill.DNS

## Class TKEYRecord

- java.lang.Object
- - org.xbill.DNS.Record
  - - org.xbill.DNS.TKEYRecord

- All Implemented Interfaces:
    Serializable, Cloneable, Comparable

      public class TKEYRecord
      extends Record

  Transaction Key - used to compute and/or securely transport a shared secret to be used with TSIG.
  Author:
    Brian Wellington
  See Also:
    `TSIG`, Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DELETE` The key should be deleted
    `static int` | `DIFFIEHELLMAN` The key is computed using a Diffie-Hellman key exchange
    `static int` | `GSSAPI` The key is computed using GSS_API (unimplemented)
    `static int` | `RESOLVERASSIGNED` The key is assigned by the resolver (unimplemented)
    `static int` | `SERVERASSIGNED` The key is assigned by the server (unimplemented)

    - ### Fields inherited from class org.xbill.DNS.Record

      `dclass, name, ttl, type`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TKEYRecord(Name name, int dclass, long ttl, Name alg, Date timeInception, Date timeExpire, int mode, int error, byte[] key, byte[] other)` Creates a TKEY Record from the given data.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Name` | `getAlgorithm()` Returns the shared key's algorithm
    `int` | `getError()` Returns the extended error
    `byte[]` | `getKey()` Returns the shared secret or keying material
    `int` | `getMode()` Returns the key agreement mode
    `byte[]` | `getOther()` Returns the other data
    `Date` | `getTimeExpire()` Returns the end of the validity period of the shared secret or keying material
    `Date` | `getTimeInception()` Returns the beginning of the validity period of the shared secret or keying material
    `protected String` | `modeString()`

    - ### Methods inherited from class org.xbill.DNS.Record

      `byteArrayFromString, byteArrayToString, compareTo, equals, fromString, fromString, fromWire, getAdditionalName, getDClass, getName, getRRsetType, getTTL, getType, hashCode, newRecord, newRecord, newRecord, newRecord, rdataToString, rdataToWireCanonical, sameRRset, toString, toWire, toWireCanonical, unknownToString, withName`

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

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

- - ### Field Detail

    - #### SERVERASSIGNED

          public static final int SERVERASSIGNED

      The key is assigned by the server (unimplemented)
      See Also:
        Constant Field Values

    - #### DIFFIEHELLMAN

          public static final int DIFFIEHELLMAN

      The key is computed using a Diffie-Hellman key exchange
      See Also:
        Constant Field Values

    - #### GSSAPI

          public static final int GSSAPI

      The key is computed using GSS_API (unimplemented)
      See Also:
        Constant Field Values

    - #### RESOLVERASSIGNED

          public static final int RESOLVERASSIGNED

      The key is assigned by the resolver (unimplemented)
      See Also:
        Constant Field Values

    - #### DELETE

          public static final int DELETE

      The key should be deleted
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TKEYRecord

          public TKEYRecord(Name name,
                    int dclass,
                    long ttl,
                    Name alg,
                    Date timeInception,
                    Date timeExpire,
                    int mode,
                    int error,
                    byte[] key,
                    byte[] other)

      Creates a TKEY Record from the given data.
      Parameters:
        `alg` - The shared key's algorithm
        `timeInception` - The beginning of the validity period of the shared secret or keying material
        `timeExpire` - The end of the validity period of the shared secret or keying material
        `mode` - The mode of key agreement
        `error` - The extended error field. Should be 0 in queries
        `key` - The shared secret
        `other` - The other data field. Currently unused responses.

  - ### Method Detail

    - #### modeString

          protected String modeString()

    - #### getAlgorithm

          public Name getAlgorithm()

      Returns the shared key's algorithm

    - #### getTimeInception

          public Date getTimeInception()

      Returns the beginning of the validity period of the shared secret or keying material

    - #### getTimeExpire

          public Date getTimeExpire()

      Returns the end of the validity period of the shared secret or keying material

    - #### getMode

          public int getMode()

      Returns the key agreement mode

    - #### getError

          public int getError()

      Returns the extended error

    - #### getKey

          public byte[] getKey()

      Returns the shared secret or keying material

    - #### getOther

          public byte[] getOther()

      Returns the other data