Package org.minidns.record
Class DNSKEY
- java.lang.Object
-
- org.minidns.record.Data
-
- org.minidns.record.DNSKEY
-
public class DNSKEY extends Data
DNSKEY record payload.
-
-
Field Summary
Fields Modifier and Type Field Description DnssecConstants.SignatureAlgorithm
algorithm
The public key's cryptographic algorithm used.byte
algorithmByte
The byte value of the public key's cryptographic algorithm used.static short
FLAG_REVOKE
Whether the record holds a revoked key.static short
FLAG_SECURE_ENTRY_POINT
Whether the key should be used as a secure entry point key.static short
FLAG_ZONE
Whether the record holds a DNS zone key.short
flags
byte
protocol
Must bePROTOCOL_RFC4034
.static byte
PROTOCOL_RFC4034
Use the protocol defined in RFC 4034.
-
Constructor Summary
Constructors Constructor Description DNSKEY(short flags, byte protocol, byte algorithm, byte[] key)
DNSKEY(short flags, byte protocol, DnssecConstants.SignatureAlgorithm algorithm, byte[] key)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getKey()
DataInputStream
getKeyAsDataInputStream()
String
getKeyBase64()
BigInteger
getKeyBigInteger()
int
getKeyLength()
int
getKeyTag()
Retrieve the key tag identifying this DNSKEY.Record.TYPE
getType()
The payload type.boolean
isSecureEntryPoint()
boolean
keyEquals(byte[] otherKey)
static DNSKEY
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
-
-
-
-
Field Detail
-
FLAG_SECURE_ENTRY_POINT
public static final short FLAG_SECURE_ENTRY_POINT
Whether the key should be used as a secure entry point key. see RFC 3757- See Also:
- Constant Field Values
-
FLAG_REVOKE
public static final short FLAG_REVOKE
Whether the record holds a revoked key.- See Also:
- Constant Field Values
-
FLAG_ZONE
public static final short FLAG_ZONE
Whether the record holds a DNS zone key.- See Also:
- Constant Field Values
-
PROTOCOL_RFC4034
public static final byte PROTOCOL_RFC4034
Use the protocol defined in RFC 4034.- See Also:
- Constant Field Values
-
flags
public final short flags
- See Also:
- IANA - DNSKEY RR Flags
-
protocol
public final byte protocol
Must bePROTOCOL_RFC4034
.
-
algorithm
public final DnssecConstants.SignatureAlgorithm algorithm
The public key's cryptographic algorithm used.
-
algorithmByte
public final byte algorithmByte
The byte value of the public key's cryptographic algorithm used.
-
-
Constructor Detail
-
DNSKEY
public DNSKEY(short flags, byte protocol, byte algorithm, byte[] key)
-
DNSKEY
public DNSKEY(short flags, byte protocol, DnssecConstants.SignatureAlgorithm algorithm, byte[] key)
-
-
Method Detail
-
parse
public static DNSKEY parse(DataInputStream dis, int length) throws IOException
- Throws:
IOException
-
getType
public Record.TYPE getType()
Description copied from class:Data
The payload type.
-
getKeyTag
public int getKeyTag()
Retrieve the key tag identifying this DNSKEY. The key tag is used within the DS and RRSIG record to distinguish multiple keys for the same name. This implementation is based on the reference implementation shown in RFC 4034 Appendix B.- Returns:
- this DNSKEY's key tag
-
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 classData
- Parameters:
dos
- the output stream to serialize to.- Throws:
IOException
- if an I/O error occurs.
-
getKeyLength
public int getKeyLength()
-
getKey
public byte[] getKey()
-
getKeyAsDataInputStream
public DataInputStream getKeyAsDataInputStream()
-
getKeyBase64
public String getKeyBase64()
-
getKeyBigInteger
public BigInteger getKeyBigInteger()
-
keyEquals
public boolean keyEquals(byte[] otherKey)
-
isSecureEntryPoint
public boolean isSecureEntryPoint()
-
-