Class AbstractNamespacesStore

    • Field Detail

      • openssl1Mode

        protected boolean openssl1Mode
    • Constructor Detail

      • AbstractNamespacesStore

        public AbstractNamespacesStore​(ObserversHandler observers,
                                       boolean openssl1Mode)
    • Method Detail

      • getNotificationType

        protected abstract java.lang.String getNotificationType()
      • getParser

        protected abstract NamespacesParser getParser​(java.lang.String path)
      • getFileSuffix

        protected abstract java.lang.String getFileSuffix()
      • tryLoadNsPath

        protected java.util.List<NamespacePolicy> tryLoadNsPath​(java.lang.String path)
      • tryLoadNsLocation

        protected void tryLoadNsLocation​(java.lang.String location,
                                         java.util.List<NamespacePolicy> policies)
      • addPolicy

        protected void addPolicy​(NamespacePolicy policy,
                                 java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.util.List<NamespacePolicy>>> policies)
        Adds a given policy to a given map. It is assumed that the map is indexed by issuer hash and the value maps are indexed by issuer id. This method is useful only for stores which keep all their namespaces in memory.
        Parameters:
        policy - policy to add
        policies - policy map to add to
      • addPolicyToMap

        protected void addPolicyToMap​(NamespacePolicy policy,
                                      java.util.Map<java.lang.String,​java.util.List<NamespacePolicy>> map)
        Adds policy to a map indexed by a policy issuer.
        Parameters:
        policy - policy to add
        map - policy map to add to
      • getPolicies

        public java.util.List<NamespacePolicy> getPolicies​(java.security.cert.X509Certificate[] chain,
                                                           int position)
        Description copied from interface: NamespacesStore
        Gets namespace policies applicable for the CA. The CA must be present in the cert chain, at the position given. The subsequent chain elements might be used if there is no explicit policy defined for the CA itself: then it is checked if any of the parent CAs defined policy for this CA.
        Specified by:
        getPolicies in interface NamespacesStore
        Parameters:
        chain - chain
        position - position
        Returns:
        policies
      • getCachedPolicies

        protected java.util.List<NamespacePolicy> getCachedPolicies​(java.util.Map<java.lang.String,​CachedElement<java.util.Map<java.lang.String,​java.util.List<NamespacePolicy>>>> policies,
                                                                    java.lang.String definedForHash,
                                                                    java.lang.String issuer,
                                                                    java.lang.String path,
                                                                    long maxTTL)
        Utility method useful for lazy stores. Retrieves a cached policies for the given ca hash and issuer. If there is no policy in the cache then it is tried to load one from disk. The loaded policy is cached before being returned.
        Parameters:
        policies - policies
        definedForHash - defined for hash
        issuer - issuer
        path - path
        maxTTL - max TTL
        Returns:
        cached policies