Interface CertPrincipalResolver

  • All Known Implementing Classes:
    PathBasedCertPrincipalResolver

    public interface CertPrincipalResolver
    Defines the interface for resolving a Principal from an X509 certificate. Implementations of this interface are responsible for extracting a specific piece of information from the certificate and converting it into a Principal.
    • Method Detail

      • resolvePrincipal

        Principal resolvePrincipal​(X509Certificate certificate)
                            throws SSLPeerUnverifiedException,
                                   CertificateParsingException
        Resolves a Principal from the given X509 certificate.

        This method is intended to extract principal information, such as a common name (CN) or an email address, from the specified certificate and encapsulate it into a Principal object. The specific field or attribute of the certificate to be used as the principal, and the logic for its extraction, is defined by the implementation.

        Parameters:
        certificate - The X509Certificate from which to resolve the principal.
        Returns:
        A Principal object representing the resolved principal from the certificate.
        Throws:
        SSLPeerUnverifiedException - If the peer's identity has not been verified.
        CertificateParsingException - If an error occurs while parsing the certificate for principal information.