java.lang.Object
org.minidns.record.Data
org.minidns.record.RRSIG
DNS RRSIG (Resource Record Signature) record payload for DNSSEC.
Contains cryptographic signature covering a set of DNS records to provide authenticity and integrity verification.
Contains cryptographic signature covering a set of DNS records to provide authenticity and integrity verification.
Field Summary
Modifier and TypeFieldDescriptionThe cryptographic algorithm used to create the signature.final byteThe cryptographic algorithm used to create the signature.private StringBase64 of the signature, computed once and keptfinal intThe key tag value of the DNSKEY RR that validates this signature.final byteThe number of labels in the original RRSIG RR owner name.final longThe TTL of the covered RRset.private final byte[]Signature that covers RRSIG RDATA (excluding the signature field) and RRset data.final DateThe date and time this RRSIG records expires.final DateThe date and time this RRSIG records starts to be valid.final DnsNameThe owner name of the DNSKEY RR that a validator is supposed to use.final Record.TYPEThe type of RRset covered by this signature.Constructor Summary
ModifierConstructorDescriptionRRSIG(Record.TYPE typeCovered, int algorithm, byte labels, long originalTtl, Date signatureExpiration, Date signatureInception, int keyTag, String signerName, byte[] signature) Create an RRSIG payload.RRSIG(Record.TYPE typeCovered, int algorithm, byte labels, long originalTtl, Date signatureExpiration, Date signatureInception, int keyTag, DnsName signerName, byte[] signature) Create an RRSIG payload.privateRRSIG(Record.TYPE typeCovered, DnssecConstants.SignatureAlgorithm algorithm, byte algorithmByte, byte labels, long originalTtl, Date signatureExpiration, Date signatureInception, int keyTag, DnsName signerName, byte[] signature) Builds a record from its parsed fields.RRSIG(Record.TYPE typeCovered, DnssecConstants.SignatureAlgorithm algorithm, byte labels, long originalTtl, Date signatureExpiration, Date signatureInception, int keyTag, String signerName, byte[] signature) Create an RRSIG payload.RRSIG(Record.TYPE typeCovered, DnssecConstants.SignatureAlgorithm algorithm, byte labels, long originalTtl, Date signatureExpiration, Date signatureInception, int keyTag, DnsName signerName, byte[] signature) Create an RRSIG payload.Method Summary
Modifier and TypeMethodDescriptionbyte[]Retrieve a copy of the signature.Expose the signature as a stream.Retrieve the signature in the base64 encoding of the RFC 4034 presentation format.intRetrieve the size of the signature in the wire format.getType()Retrieve the type of this record.static RRSIGparse(DataInputStream dis, byte[] data, int length) Parse the RDATA of an RRSIG record.voidWrite the RDATA of this record.toString()Format this record in the presentation format of RFC 4034.voidWrite the RRSIG RDATA without the trailing signature, which is the part a validator has to feed into the signature calculation.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.
Field Details
typeCovered
The type of RRset covered by this signature.algorithm
The cryptographic algorithm used to create the signature.algorithmByte
public final byte algorithmByteThe cryptographic algorithm used to create the signature.labels
public final byte labelsThe number of labels in the original RRSIG RR owner name.originalTtl
public final long originalTtlThe TTL of the covered RRset.signatureExpiration
The date and time this RRSIG records expires.signatureInception
The date and time this RRSIG records starts to be valid.keyTag
public final int keyTagThe key tag value of the DNSKEY RR that validates this signature.signerName
The owner name of the DNSKEY RR that a validator is supposed to use.signature
private final byte[] signatureSignature that covers RRSIG RDATA (excluding the signature field) and RRset data.base64SignatureCache
Base64 of the signature, computed once and kept
Constructor Details
RRSIG
private RRSIG(Record.TYPE typeCovered, DnssecConstants.SignatureAlgorithm algorithm, byte algorithmByte, byte labels, long originalTtl, Date signatureExpiration, Date signatureInception, int keyTag, DnsName signerName, byte[] signature) Builds a record from its parsed fields.- Parameters:
typeCovered- the type the signature coversalgorithm- the signature algorithm, or nullalgorithmByte- the algorithm number from the wirelabels- the label count the signer usedoriginalTtl- the TTL of the original recordsignatureExpiration- when the signature expiressignatureInception- when the signature becomes validkeyTag- the signer's key tagsignerName- the signer's domain namesignature- the signature bytes
RRSIG
public RRSIG(Record.TYPE typeCovered, int algorithm, byte labels, long originalTtl, Date signatureExpiration, Date signatureInception, int keyTag, DnsName signerName, byte[] signature) Create an RRSIG payload.- Parameters:
typeCovered- the RR type of the RRset this signature covers.algorithm- the DNSSEC signing algorithm number of RFC 4034.labels- the number of labels of the owner name of the covered RRset, the wildcard label of a wildcard RRset not counted.originalTtl- the TTL in seconds of the covered RRset in the signed zone.signatureExpiration- the time from which on the signature expires.signatureInception- the time from which on the signature is valid.keyTag- the key tag of the DNSKEY which must validate this signature.signerName- the owner name of the DNSKEY RRset holding the signing key.signature- the signature over the RRSIG RDATA without the signature field and over the covered RRset.
RRSIG
public RRSIG(Record.TYPE typeCovered, int algorithm, byte labels, long originalTtl, Date signatureExpiration, Date signatureInception, int keyTag, String signerName, byte[] signature) Create an RRSIG payload.- Parameters:
typeCovered- the RR type of the RRset this signature covers.algorithm- the DNSSEC signing algorithm number of RFC 4034.labels- the number of labels of the owner name of the covered RRset, the wildcard label of a wildcard RRset not counted.originalTtl- the TTL in seconds of the covered RRset in the signed zone.signatureExpiration- the time from which on the signature expires.signatureInception- the time from which on the signature is valid.keyTag- the key tag of the DNSKEY which must validate this signature.signerName- the owner name of the DNSKEY RRset holding the signing key, in presentation format.signature- the signature over the RRSIG RDATA without the signature field and over the covered RRset.
RRSIG
public RRSIG(Record.TYPE typeCovered, DnssecConstants.SignatureAlgorithm algorithm, byte labels, long originalTtl, Date signatureExpiration, Date signatureInception, int keyTag, DnsName signerName, byte[] signature) Create an RRSIG payload.- Parameters:
typeCovered- the RR type of the RRset this signature covers.algorithm- the DNSSEC signing algorithm.labels- the number of labels of the owner name of the covered RRset, the wildcard label of a wildcard RRset not counted.originalTtl- the TTL in seconds of the covered RRset in the signed zone.signatureExpiration- the time from which on the signature expires.signatureInception- the time from which on the signature is valid.keyTag- the key tag of the DNSKEY which must validate this signature.signerName- the owner name of the DNSKEY RRset holding the signing key.signature- the signature over the RRSIG RDATA without the signature field and over the covered RRset.
RRSIG
public RRSIG(Record.TYPE typeCovered, DnssecConstants.SignatureAlgorithm algorithm, byte labels, long originalTtl, Date signatureExpiration, Date signatureInception, int keyTag, String signerName, byte[] signature) Create an RRSIG payload.- Parameters:
typeCovered- the RR type of the RRset this signature covers.algorithm- the DNSSEC signing algorithm.labels- the number of labels of the owner name of the covered RRset, the wildcard label of a wildcard RRset not counted.originalTtl- the TTL in seconds of the covered RRset in the signed zone.signatureExpiration- the time from which on the signature expires.signatureInception- the time from which on the signature is valid.keyTag- the key tag of the DNSKEY which must validate this signature.signerName- the owner name of the DNSKEY RRset holding the signing key, in presentation format.signature- the signature over the RRSIG RDATA without the signature field and over the covered RRset.
Method Details
parse
Parse the RDATA of an RRSIG record.- Parameters:
dis- the stream positioned at the start of the RDATA.data- the full message data, needed to decompress the signer name.length- the RDLENGTH of this record in bytes.- Returns:
- the parsed RRSIG payload.
- Throws:
IOException- if the RDATA is too short for the fixed RRSIG fields or for the signature trailing the signer name.
getSignature
public byte[] getSignature()Retrieve a copy of the signature.- Returns:
- a copy of the signature bytes.
getSignatureAsDataInputStream
Expose the signature as a stream.- Returns:
- a stream to read the signature bytes from.
getSignatureLength
public int getSignatureLength()Retrieve the size of the signature in the wire format.- Returns:
- the length of the signature in bytes.
getSignatureBase64
Retrieve the signature in the base64 encoding of the RFC 4034 presentation format.- Returns:
- the base64 encoded signature.
getType
Retrieve the type of this record.serialize
Write the RDATA of this record.- Specified by:
serializein classData- Parameters:
dos- the stream to write to.- Throws:
IOException- if an I/O error occurs.
writePartialSignature
Write the RRSIG RDATA without the trailing signature, which is the part a validator has to feed into the signature calculation.- Parameters:
dos- the stream to write to.- Throws:
IOException- if an I/O error occurs.
toString