Package org.jitsi.dnssec.validator
Class KeyEntry
- java.lang.Object
-
- org.jitsi.dnssec.validator.KeyEntry
-
public final class KeyEntry extends java.lang.ObjectDNSKEY 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.StringgetBadReason()Gets the reason why this key entry is bad.intgetDClass()Gets the DNS class.org.xbill.DNS.NamegetName()Gets the name of the cache entry.SRRsetgetRRset()Gets the DNSKEYs for the cached key entry.longgetTTL()Gets the TTL [s].booleanisBad()Gets an indication if this is a bad key, i.e.booleanisGood()Gets an indication if this is a good key, i.e.booleanisNull()Gets an indication if this is a null key, i.e.static KeyEntrynewBadKeyEntry(org.xbill.DNS.Name n, int dclass, long ttl)Creates a new bad key entry without actual DNSKEYs, i.e.static KeyEntrynewKeyEntry(SRRset rrset)Creates a new key entry from actual DNSKEYs.static KeyEntrynewNullKeyEntry(org.xbill.DNS.Name n, int dclass, long ttl)Creates a new trusted key entry without actual DNSKEYs, i.e.voidsetBadReason(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:
Trueis it is null,falseotherwise.
-
isBad
public boolean isBad()
Gets an indication if this is a bad key, i.e. an invalid response.- Returns:
Trueis it is bad,falseotherwise.
-
isGood
public boolean isGood()
Gets an indication if this is a good key, i.e. a proven secure response with keys.- Returns:
Trueis it is good,falseotherwise.
-
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.
-
-