Class CertUtils


  • public class CertUtils
    extends Object
    This class provides utility methods to read the certificate DN information in a format that is understandable across OpenAM.
    • Constructor Detail

      • CertUtils

        public CertUtils()
    • Method Detail

      • getSubjectName

        public static String getSubjectName​(X509Certificate cert)
        Returns the Subject Name from the X509Certificate's subject X500Principal.
        Parameters:
        cert - X509 Certificate Object.
        Returns:
        null if the SubjectDN can not be obtained.
      • getIssuerName

        public static String getIssuerName​(X509Certificate cert)
        Returns the Issuer Name from the X509Certificate's issuer X500Principal.
        Parameters:
        cert - X509 Certificate Object.
        Returns:
        null if the IssuerDN can not be obtained.
      • getAttributeValue

        public static String getAttributeValue​(X500Principal principal,
                                               String attributeName)
        Retrieves a given attribute value from the provided X500Principal even if the attribute was enclosed in a multi-valued RDN.
        Parameters:
        principal - The principal to retrieve the value from.
        attributeName - The non-null name of the attribute to retrieve.
        Returns:
        The attribute value from the principal.