org.xbill.DNS
Class KEYRecord

java.lang.Object
  extended by org.xbill.DNS.Record
      extended by org.xbill.DNS.KEYRecord
All Implemented Interfaces:
Cloneable, Comparable

public class KEYRecord
extends Record

Key - contains a cryptographic public key. The data can be converted to objects implementing java.security.interfaces.PublicKey

Author:
Brian Wellington
See Also:
DNSSEC

Nested Class Summary
static class KEYRecord.Flags
           
static class KEYRecord.Protocol
           
 
Field Summary
protected  int alg
           
static int FLAG_NOAUTH
          This key cannot be used for authentication
static int FLAG_NOCONF
          This key cannot be used for confidentiality (encryption)
static int FLAG_NOKEY
          This key cannot be used for authentication or confidentiality
protected  int flags
           
protected  int footprint
           
protected  byte[] key
           
static int OWNER_HOST
          A host/end entity key
static int OWNER_USER
          A user key
static int OWNER_ZONE
          A zone key
protected  int proto
           
static int PROTOCOL_ANY
          Key was created for use with any protocol
static int PROTOCOL_DNSSEC
          Key was created for use with DNSSEC
static int PROTOCOL_EMAIL
          Key was created for use with email
static int PROTOCOL_IPSEC
          Key was created for use with IPSEC
static int PROTOCOL_TLS
          Key was created for use with transaction level security
 
Fields inherited from class org.xbill.DNS.Record
dclass, name, ttl, type
 
Constructor Summary
KEYRecord(Name name, int dclass, long ttl, int flags, int proto, int alg, byte[] key)
          Creates a KEY Record from the given data
 
Method Summary
 int getAlgorithm()
          Returns the key's algorithm
 int getFlags()
          Returns the flags describing the key's properties
 int getFootprint()
          Returns the key's footprint (after computing it)
 byte[] getKey()
          Returns the binary data representing the key
 int getProtocol()
          Returns the protocol that the key was created for
 
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

FLAG_NOCONF

public static final int FLAG_NOCONF
This key cannot be used for confidentiality (encryption)

See Also:
Constant Field Values

FLAG_NOAUTH

public static final int FLAG_NOAUTH
This key cannot be used for authentication

See Also:
Constant Field Values

FLAG_NOKEY

public static final int FLAG_NOKEY
This key cannot be used for authentication or confidentiality

See Also:
Constant Field Values

OWNER_ZONE

public static final int OWNER_ZONE
A zone key

See Also:
Constant Field Values

OWNER_HOST

public static final int OWNER_HOST
A host/end entity key

See Also:
Constant Field Values

OWNER_USER

public static final int OWNER_USER
A user key

See Also:
Constant Field Values

PROTOCOL_TLS

public static final int PROTOCOL_TLS
Key was created for use with transaction level security

See Also:
Constant Field Values

PROTOCOL_EMAIL

public static final int PROTOCOL_EMAIL
Key was created for use with email

See Also:
Constant Field Values

PROTOCOL_DNSSEC

public static final int PROTOCOL_DNSSEC
Key was created for use with DNSSEC

See Also:
Constant Field Values

PROTOCOL_IPSEC

public static final int PROTOCOL_IPSEC
Key was created for use with IPSEC

See Also:
Constant Field Values

PROTOCOL_ANY

public static final int PROTOCOL_ANY
Key was created for use with any protocol

See Also:
Constant Field Values

flags

protected int flags

proto

protected int proto

alg

protected int alg

key

protected byte[] key

footprint

protected int footprint
Constructor Detail

KEYRecord

public KEYRecord(Name name,
                 int dclass,
                 long ttl,
                 int flags,
                 int proto,
                 int alg,
                 byte[] key)
Creates a KEY Record from the given data

Parameters:
flags - Flags describing the key's properties
proto - The protocol that the key was created for
alg - The key's algorithm
key - Binary data representing the key
Method Detail

getFlags

public int getFlags()
Returns the flags describing the key's properties


getProtocol

public int getProtocol()
Returns the protocol that the key was created for


getAlgorithm

public int getAlgorithm()
Returns the key's algorithm


getKey

public byte[] getKey()
Returns the binary data representing the key


getFootprint

public int getFootprint()
Returns the key's footprint (after computing it)