Class KeyEntry

All Implemented Interfaces:
Serializable, Iterable<Record>

final class KeyEntry extends SRRset
DNSKEY cache entry for a given Name, with or without actual keys.
Since:
3.5
  • Field Details

    • algo

      private final List<Integer> algo
      List of algorithms signalled, may be null.
    • edeReason

      private int edeReason
    • badReason

      private String badReason
    • isEmpty

      private boolean isEmpty
  • Constructor Details

    • KeyEntry

      private KeyEntry(SRRset rrset)
      Create a new, positive key entry.
      Parameters:
      rrset - The set of records to cache.
    • KeyEntry

      private KeyEntry(SRRset rrset, List<Integer> sigalg)
      Create a new, positive key entry.
      Parameters:
      rrset - The set of records to cache.
      sigalg - signalled algorithm list, may be null.
    • KeyEntry

      private KeyEntry(Name name, int dclass, long ttl, boolean isBad)
  • Method Details

    • 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.
    • newKeyEntry

      public static KeyEntry newKeyEntry(SRRset rrset, List<Integer> sigalg)
      Creates a new key entry from actual DNSKEYs.
      Parameters:
      rrset - The DNSKEYs to cache.
      sigalg - signalled algorithm list, may be null.
      Returns:
      The created key entry.
    • newNullKeyEntry

      public static KeyEntry newNullKeyEntry(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(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
    • 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.
    • setBadReason

      public void setBadReason(int edeReason, String reason)
      Sets the reason why this key entry is bad.
      Parameters:
      reason - The reason why this key entry is bad.
    • validateKeyFor

      JustifiedSecStatus validateKeyFor(SRRset set)
      Validate if this key instance is valid for the specified name.
      Parameters:
      set - the set against which this key is validated.
      Returns:
      A security status indicating if this key is valid, or if not, why.