Package org.jitsi.dnssec.validator
Class KeyEntry
- java.lang.Object
-
- org.jitsi.dnssec.validator.KeyEntry
-
public final class KeyEntry extends java.lang.Object
DNSKEY cache entry for a givenName
, with or without actual keys.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBadReason()
Gets the reason why this key entry is bad.int
getDClass()
Gets the DNS class.org.xbill.DNS.Name
getName()
Gets the name of the cache entry.SRRset
getRRset()
Gets the DNSKEYs for the cached key entry.long
getTTL()
Gets the TTL [s].boolean
isBad()
Gets an indication if this is a bad key, i.e.boolean
isGood()
Gets an indication if this is a good key, i.e.boolean
isNull()
Gets an indication if this is a null key, i.e.static KeyEntry
newBadKeyEntry(org.xbill.DNS.Name n, int dclass, long ttl)
Creates a new bad key entry without actual DNSKEYs, i.e.static KeyEntry
newKeyEntry(SRRset rrset)
Creates a new key entry from actual DNSKEYs.static KeyEntry
newNullKeyEntry(org.xbill.DNS.Name n, int dclass, long ttl)
Creates a new trusted key entry without actual DNSKEYs, i.e.void
setBadReason(java.lang.String reason)
Sets the reason why this key entry is bad.
-
-
-
Method Detail
-
newKeyEntry
public static KeyEntry newKeyEntry(SRRset rrset)
Creates a new key entry from actual DNSKEYs.- Parameters:
rrset
- The DNSKEYs to cache.- Returns:
- The created key entry.
-
newNullKeyEntry
public static KeyEntry newNullKeyEntry(org.xbill.DNS.Name n, int dclass, long ttl)
Creates a new trusted key entry without actual DNSKEYs, i.e. it is proven that there are no keys.- Parameters:
n
- The name for which the empty cache entry is created.dclass
- The DNS class.ttl
- The TTL [s].- Returns:
- The created key entry.
-
newBadKeyEntry
public static KeyEntry newBadKeyEntry(org.xbill.DNS.Name n, int dclass, long ttl)
Creates a new bad key entry without actual DNSKEYs, i.e. from a response that did not validate.- Parameters:
n
- The name for which the bad cache entry is created.dclass
- The DNS class.ttl
- The TTL [s].- Returns:
- The created key entry.s
-
getRRset
public SRRset getRRset()
Gets the DNSKEYs for the cached key entry. Can benull
.- Returns:
- The DNSKEYs for the cached key entry. Can be
null
.
-
getName
public org.xbill.DNS.Name getName()
Gets the name of the cache entry.- Returns:
- The name of the cache entry.
-
getDClass
public int getDClass()
Gets the DNS class.- Returns:
- The DNS class.
-
getTTL
public long getTTL()
Gets the TTL [s].- Returns:
- The TTL [s].
-
isNull
public boolean isNull()
Gets an indication if this is a null key, i.e. a proven secure response without keys.- Returns:
True
is it is null,false
otherwise.
-
isBad
public boolean isBad()
Gets an indication if this is a bad key, i.e. an invalid response.- Returns:
True
is it is bad,false
otherwise.
-
isGood
public boolean isGood()
Gets an indication if this is a good key, i.e. a proven secure response with keys.- Returns:
True
is it is good,false
otherwise.
-
getBadReason
public java.lang.String getBadReason()
Gets the reason why this key entry is bad.- Returns:
- The reason why this key entry is bad.
-
setBadReason
public void setBadReason(java.lang.String reason)
Sets the reason why this key entry is bad.- Parameters:
reason
- The reason why this key entry is bad.
-
-