Class KeyCache


  • public class KeyCache
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String MAX_CACHE_SIZE_CONFIG
      Name of the property that configures the maximum cache size.
      static java.lang.String MAX_TTL_CONFIG
      Name of the property that configures the maximum cache TTL.
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyCache()
      Creates a new instance of this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      KeyEntry find​(org.xbill.DNS.Name n, int dclass)
      Find the 'closest' trusted DNSKEY rrset to the given name.
      void init​(java.util.Properties config)
      Initialize the cache.
      KeyEntry store​(KeyEntry ke)
      Store a KeyEntry in the cache.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MAX_TTL_CONFIG

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

        public static final java.lang.String MAX_CACHE_SIZE_CONFIG
        Name of the property that configures the maximum cache size.
        See Also:
        Constant Field Values
    • Constructor Detail

      • KeyCache

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

      • init

        public void init​(java.util.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.