X500Principal
.-
Field Summary
FieldsModifier and TypeFieldDescriptionMaps required X500 OID values to standard short names -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getCommonName
(X500Principal principal) Determines the common name of a principal.Parses an X.500 Distinguished Name (DN)
-
Field Details
-
X500_OIDMAP
Maps required X500 OID values to standard short names
-
-
Method Details
-
getCommonName
Determines the common name of a principal.- Parameters:
principal
- principal- Returns:
- parsed CN value from
X500Principal
; elsePrincipal.getName()
-
parse
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. UseX500Principal.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:
-