Class KeyCache

java.lang.Object
org.jitsi.dnssec.validator.KeyCache

public class KeyCache extends Object
Cache for DNSKEY RRsets or corresponding null/bad key entries with a limited size and respect for TTL values.
Author:
davidb, Ingo Bauersachs
  • Field Details

    • MAX_TTL_CONFIG

      public static final String MAX_TTL_CONFIG
      Name of the property that configures the maximum cache TTL.
      See Also:
    • MAX_CACHE_SIZE_CONFIG

      public static final String MAX_CACHE_SIZE_CONFIG
      Name of the property that configures the maximum cache size.
      See Also:
  • Constructor Details

    • KeyCache

      public KeyCache()
      Creates a new instance of this class.
  • Method Details

    • init

      public void init(Properties config)
      Initialize the cache. This implementation recognizes the following configuration parameters:
      org.jitsi.dnssec.keycache.max_ttl
      The maximum TTL to apply to any cache entry.
      org.jitsi.dnssec.keycache.max_size
      The maximum number of entries that the cache will hold.
      Parameters:
      config - The configuration information.
    • find

      public KeyEntry find(org.xbill.DNS.Name n, int dclass)
      Find the 'closest' trusted DNSKEY rrset to the given name.
      Parameters:
      n - The name to start the search.
      dclass - The class this DNSKEY rrset should be in.
      Returns:
      The 'closest' entry to 'n' in the same class as 'dclass'.
    • store

      public KeyEntry store(KeyEntry ke)
      Store a KeyEntry in the cache. The entry will be ignored if it's rrset isn't a DNSKEY rrset or if it doesn't have the SECURE security status.
      Parameters:
      ke - The key entry to cache.
      Returns:
      The passed KeyEntry to allow method chaining.