Package org.jitsi.dnssec.validator
Class ValidatingResolver
java.lang.Object
org.jitsi.dnssec.validator.ValidatingResolver
- All Implemented Interfaces:
org.xbill.DNS.Resolver
This resolver validates responses with DNSSEC.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe QCLASS being used for the injection of the reason why the validator came to the returned result. -
Constructor Summary
ConstructorsConstructorDescriptionValidatingResolver(org.xbill.DNS.Resolver headResolver) Creates a new instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionGets the store with the loaded trust anchors.voidinit(Properties config) Initialize the module.voidloadTrustAnchors(InputStream data) Load the trust anchor file into the trust anchor store.org.xbill.DNS.Messagesend(org.xbill.DNS.Message query) Sends a message and validates the response with DNSSEC before returning it.sendAsync(org.xbill.DNS.Message query, org.xbill.DNS.ResolverListener listener) Not implemented.voidsetEDNS(int level) This is a no-op, EDNS is always set to level 0.voidThe method is forwarded to the resolver, but always ensure that the level is 0 and the flags contains DO.voidsetIgnoreTruncation(boolean flag) This is a no-op, truncation is never ignored.voidsetPort(int port) Forwards the data to the head resolver passed at construction time.voidsetTCP(boolean flag) Forwards the data to the head resolver passed at construction time.voidsetTimeout(int secs) Sets the amount of time to wait for a response before giving up.voidsetTimeout(int secs, int msecs) Sets the amount of time to wait for a response before giving up.voidsetTSIGKey(org.xbill.DNS.TSIG key) Forwards the data to the head resolver passed at construction time.
-
Field Details
-
VALIDATION_REASON_QCLASS
public static final int VALIDATION_REASON_QCLASSThe QCLASS being used for the injection of the reason why the validator came to the returned result.- See Also:
-
-
Constructor Details
-
ValidatingResolver
public ValidatingResolver(org.xbill.DNS.Resolver headResolver) Creates a new instance of this class.- Parameters:
headResolver- The resolver to which queries for DS, DNSKEY and referring CNAME records are sent.
-
-
Method Details
-
init
Initialize the module. The only recognized configuration value is org.jitsi.dnssec.trust_anchor_file.- Parameters:
config- The configuration data for this module.- Throws:
IOException- When the file specified in the config does not exist or cannot be read.
-
loadTrustAnchors
Load the trust anchor file into the trust anchor store. The trust anchors are currently stored in a zone file format list of DNSKEY or DS records.- Parameters:
data- The trust anchor data.- Throws:
IOException- when the trust anchor data could not be read.
-
getTrustAnchors
Gets the store with the loaded trust anchors.- Returns:
- The store with the loaded trust anchors.
-
setPort
public void setPort(int port) Forwards the data to the head resolver passed at construction time.- Specified by:
setPortin interfaceorg.xbill.DNS.Resolver- Parameters:
port- The IP destination port for the queries sent.- See Also:
-
setTCP
public void setTCP(boolean flag) Forwards the data to the head resolver passed at construction time.- Specified by:
setTCPin interfaceorg.xbill.DNS.Resolver- Parameters:
flag-trueto enable TCP,falseto disable it.- See Also:
-
setIgnoreTruncation
public void setIgnoreTruncation(boolean flag) This is a no-op, truncation is never ignored.- Specified by:
setIgnoreTruncationin interfaceorg.xbill.DNS.Resolver- Parameters:
flag- unused
-
setEDNS
public void setEDNS(int level) This is a no-op, EDNS is always set to level 0.- Specified by:
setEDNSin interfaceorg.xbill.DNS.Resolver- Parameters:
level- unused
-
setEDNS
The method is forwarded to the resolver, but always ensure that the level is 0 and the flags contains DO.- Specified by:
setEDNSin interfaceorg.xbill.DNS.Resolver- Parameters:
level- unused, always set to 0.payloadSize- The maximum DNS packet size that this host is capable of receiving over UDP. If 0 is specified, the default (1280) is used.flags- EDNS extended flags to be set in the OPT record,ExtendedFlags.DOis always appended.options- EDNS options to be set in the OPT record, specified as a List of OPTRecord.Option elements.- See Also:
-
setTSIGKey
public void setTSIGKey(org.xbill.DNS.TSIG key) Forwards the data to the head resolver passed at construction time.- Specified by:
setTSIGKeyin interfaceorg.xbill.DNS.Resolver- Parameters:
key- The key.- See Also:
-
setTimeout
public void setTimeout(int secs, int msecs) Sets the amount of time to wait for a response before giving up. This applies only to the head resolver, the time for an actual query to the validating resolver IS higher.- Specified by:
setTimeoutin interfaceorg.xbill.DNS.Resolver- Parameters:
secs- The number of seconds to wait.msecs- The number of milliseconds to wait.
-
setTimeout
public void setTimeout(int secs) Sets the amount of time to wait for a response before giving up. This applies only to the head resolver, the time for an actual query to the validating resolver IS higher.- Specified by:
setTimeoutin interfaceorg.xbill.DNS.Resolver- Parameters:
secs- The number of seconds to wait.
-
send
Sends a message and validates the response with DNSSEC before returning it.- Specified by:
sendin interfaceorg.xbill.DNS.Resolver- Parameters:
query- The query to send.- Returns:
- The validated response message.
- Throws:
IOException- An error occurred while sending or receiving.
-
sendAsync
Not implemented.- Specified by:
sendAsyncin interfaceorg.xbill.DNS.Resolver- Parameters:
query- The query to sendlistener- The object containing the callbacks.- Returns:
- An identifier, which is also a parameter in the callback
- Throws:
UnsupportedOperationException- Always
-