Package org.apache.solr.security.cert
Class PathBasedCertResolverBase
- java.lang.Object
-
- org.apache.solr.security.cert.PathBasedCertResolverBase
-
- Direct Known Subclasses:
PathBasedCertPrincipalResolver
public abstract class PathBasedCertResolverBase extends Object
Abstract base class for implementing path-based certificate resolvers. This class provides common functionality for extracting and processing certificate information based on configurable paths and filters.
-
-
Constructor Summary
Constructors Constructor Description PathBasedCertResolverBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CertResolverPatterncreateCertResolverPattern(Map<String,Object> config, String defaultPath)Creates aCertResolverPatternfrom a given configuration map and a default path.protected Map<String,Set<String>>getValuesFromPaths(X509Certificate certificate, List<CertResolverPattern> patterns)Extracts values from specified paths in a certificate and organizes them into a map.
-
-
-
Method Detail
-
createCertResolverPattern
protected CertResolverPattern createCertResolverPattern(Map<String,Object> config, String defaultPath)
Creates aCertResolverPatternfrom a given configuration map and a default path. The pattern defines how certificate information should be extracted and processed.- Parameters:
config- The configuration map containing resolver settings.defaultPath- The default path to use if none is specified in the configuration.- Returns:
- A new instance of
CertResolverPatternbased on the provided configuration.
-
getValuesFromPaths
protected Map<String,Set<String>> getValuesFromPaths(X509Certificate certificate, List<CertResolverPattern> patterns) throws CertificateParsingException
Extracts values from specified paths in a certificate and organizes them into a map. The map's keys are derived from the names specified in the patterns, and the values are sets of strings extracted from the certificate according to the pattern definitions.- Parameters:
certificate- The X509Certificate from which to extract information.patterns- A list ofCertResolverPatternobjects defining the extraction criteria.- Returns:
- A map where each key is a pattern name and each value is a set of extracted strings.
- Throws:
CertificateParsingException- If an error occurs while parsing the certificate.
-
-