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.SignatureAlgorithmalgorithmThe public key's cryptographic algorithm used.bytealgorithmByteThe byte value of the public key's cryptographic algorithm used.static shortFLAG_REVOKEWhether the record holds a revoked key.static shortFLAG_SECURE_ENTRY_POINTWhether the key should be used as a secure entry point key.static shortFLAG_ZONEWhether the record holds a DNS zone key.shortflagsbyteprotocolMust bePROTOCOL_RFC4034.static bytePROTOCOL_RFC4034Use 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()DataInputStreamgetKeyAsDataInputStream()StringgetKeyBase64()BigIntegergetKeyBigInteger()intgetKeyLength()intgetKeyTag()Retrieve the key tag identifying this DNSKEY.Record.TYPEgetType()The payload type.booleanisSecureEntryPoint()booleankeyEquals(byte[] otherKey)static DNSKEYparse(DataInputStream dis, int length)voidserialize(DataOutputStream dos)The internal method used to serialize Data subclasses.StringtoString()-
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:DataThe 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:DataThe internal method used to serialize Data subclasses.- Specified by:
serializein 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()
-
-