java.lang.Object
org.minidns.record.Data
org.minidns.record.DelegatingDnssecRR
org.minidns.record.DS
DNS DS (Delegation Signer) record payload for DNSSEC.
Contains the hash of a DNSKEY record used to authenticate delegated DNS zones in DNSSEC chain of trust.
Contains the hash of a DNSKEY record used to authenticate delegated DNS zones in DNSSEC chain of trust.
- See Also:
Nested Class Summary
Nested classes/interfaces inherited from class DelegatingDnssecRR
DelegatingDnssecRR.SharedDataModifier and TypeClassDescriptionprotected static final classThe fixed fields read out of a delegation record, before it is interpreted.Field Summary
Fields inherited from class DelegatingDnssecRR
algorithm, algorithmByte, digest, digestType, digestTypeByte, keyTagModifier and TypeFieldDescriptionThe cryptographic algorithm used to create the signature.final byteThe byte value of the cryptographic algorithm used to create the signature.protected final byte[]The digest build from a DNSKEY.The algorithm used to construct the digest.final byteThe byte value of algorithm used to construct the digest.final intThe key tag value of the DNSKEY RR that validates this signature.Constructor Summary
ConstructorsConstructorDescriptionDS(int keyTag, byte algorithm, byte digestType, byte[] digest) Create a DS record, keeping the signature and digest algorithms as raw numbers for use when MiniDNS does not recognize them.DS(int keyTag, DnssecConstants.SignatureAlgorithm algorithm, byte digestType, byte[] digest) Create a DS record with a known signature algorithm but a digest type that is kept as a raw number.DS(int keyTag, DnssecConstants.SignatureAlgorithm algorithm, DnssecConstants.DigestAlgorithm digestType, byte[] digest) Create a DS record with both the signature and the digest algorithm resolved to the constants MiniDNS knows.Method Summary
Modifier and TypeMethodDescriptiongetType()Report the RR type constant that identifies this payload as a DS record.static DSparse(DataInputStream dis, int length) Read a DS record payload from a wire-format stream.Methods inherited from class DelegatingDnssecRR
digestEquals, getDigestBigInteger, getDigestHex, parseSharedData, serialize, toStringModifier and TypeMethodDescriptionbooleandigestEquals(byte[] otherDigest) Compares this record's DNSKEY digest with another byte by byte.Gets the DNSKEY digest as an unsigned big-endian integer.Gets the DNSKEY digest as upper-case hexadecimal.protected static DelegatingDnssecRR.SharedDataparseSharedData(DataInputStream dis, int length) Reads the key tag, algorithm bytes and digest that DNSSEC records share.voidWrites the key tag, algorithm bytes and digest to the wire.toString()Renders the delegation as key tag, algorithms and digest.Methods inherited from class Data
equals, hashCode, length, toByteArray, toOutputStream, toOutputStreamModifier and TypeMethodDescriptionfinal booleanfinal inthashCode()final intlength()Serialize this record, if that has not been done already, and report the resulting wire size.final byte[]Serialize this record, if that has not been done already, and return a copy of the result so callers cannot mutate the cached bytes.final voidWrite the binary representation of this payload to the givenDataOutputStream.final voidtoOutputStream(OutputStream outputStream) Write the binary representation to the given OutputStream.
Constructor Details
DS
public DS(int keyTag, byte algorithm, byte digestType, byte[] digest) Create a DS record, keeping the signature and digest algorithms as raw numbers for use when MiniDNS does not recognize them.- Parameters:
keyTag- the key tag of the DNSKEY RR that validates this delegation's signaturealgorithm- the wire signature algorithm bytedigestType- the wire digest algorithm bytedigest- the DNSKEY digest, which must not be null
DS
Create a DS record with a known signature algorithm but a digest type that is kept as a raw number.- Parameters:
keyTag- the key tag of the DNSKEY RR that validates this delegation's signaturealgorithm- the signing algorithm, resolved from its wire valuedigestType- the wire digest algorithm bytedigest- the DNSKEY digest, which must not be null
DS
public DS(int keyTag, DnssecConstants.SignatureAlgorithm algorithm, DnssecConstants.DigestAlgorithm digestType, byte[] digest) Create a DS record with both the signature and the digest algorithm resolved to the constants MiniDNS knows.- Parameters:
keyTag- the key tag of the DNSKEY RR that validates this delegation's signaturealgorithm- the signing algorithm, resolved from its wire valuedigestType- the hashing algorithm the DNSKEY was digested withdigest- the DNSKEY digest, which must not be null
Method Details
parse
Read a DS record payload from a wire-format stream.- Parameters:
dis- the stream positioned at the start of the record payloadlength- the length in bytes of the record payload- Returns:
- the parsed DS record
- Throws:
IOException- if the payload cannot be read from the stream
getType
Report the RR type constant that identifies this payload as a DS record.