Class X500Utils

java.lang.Object
edu.iu.auth.config.X500Utils

public final class X500Utils extends Object
Provides basic metadata inspection utilities for X500Principal.
  • Field Details

    • X500_OIDMAP

      static Map<String,String> X500_OIDMAP
      Maps required X500 OID values to standard short names
  • Method Details

    • getCommonName

      public static String getCommonName(X500Principal principal)
      Determines the common name of a principal.
      Parameters:
      principal - principal
      Returns:
      parsed CN value from X500Principal; else Principal.getName()
    • parse

      public static Iterable<Map<String,String>> parse(String name)
      Parses an X.500 Distinguished Name (DN)

      The purpose of this method is to facilitate inspection of specific standard attributes used with principal system and user identifying certificates. Certificates that provide X500Principal instances should be verified as trusted using the delivered JCE provider prior to passing a raw DN to this method. Use X500Principal.getName() to validate the input value for this method if retrieved from a user-provided certificate.

      The response iterates Relative Distinguished Names mappings as defined for X.500 by RFC-4514 LDAP.

      This utility method only implements a simple parser of the ABNF grammar defined in RFC-4514 Section 4; it is not intended as part of larger implementation. Since JCE X500 functionality is implemented in non-exported packages of java.base, access to the security layer's parser is not allowed in a modular environment. The LDAP parser in javax.naming is not appropriate for this use.

      Parameters:
      name - serialized X.500 DN
      Returns:
      parsed DN
      See Also: