Package org.opensaml.security.x509
Class InternalX500DNHandler
java.lang.Object
org.opensaml.security.x509.InternalX500DNHandler
- All Implemented Interfaces:
X500DNHandler
Basic implementation of
X500DNHandler
which uses the internal built-in mechanisms
provided by X500Principal
directly.-
Field Summary
Fields inherited from interface org.opensaml.security.x509.X500DNHandler
FORMAT_RFC1779, FORMAT_RFC2253
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone the handler.byte[]
getEncoded
(X500Principal principal) Returns the distinguished name in ASN.1 DER encoded form.getName
(X500Principal principal) Returns a string representation of the X.500 distinguished name using the default format as defined in the underlying implementation.getName
(X500Principal principal, String format) Returns a string representation of the X.500 distinguished name using the specified format.parse
(byte[] name) Parse the ASN.1 DER encoding representation of a name and build a new principal instance.Parse the string representation of a name and build a new principal instance.
-
Constructor Details
-
InternalX500DNHandler
public InternalX500DNHandler()
-
-
Method Details
-
getEncoded
Returns the distinguished name in ASN.1 DER encoded form.- Specified by:
getEncoded
in interfaceX500DNHandler
- Parameters:
principal
- the principal name instance to serialize- Returns:
- the serialized name in ASN.1 DER encoded form
-
getName
Returns a string representation of the X.500 distinguished name using the default format as defined in the underlying implementation.- Specified by:
getName
in interfaceX500DNHandler
- Parameters:
principal
- the principal name instance to serialize- Returns:
- the serialized string name
-
getName
Returns a string representation of the X.500 distinguished name using the specified format. The values and meanings of the format specifier are implementation dependent. Constants for two common standard formats are provided here asX500DNHandler.FORMAT_RFC1779
andX500DNHandler.FORMAT_RFC2253
;- Specified by:
getName
in interfaceX500DNHandler
- Parameters:
principal
- the principal name instance to serializeformat
- the format specifier of the resulting serialized string name- Returns:
- the serialized string name
-
parse
Parse the string representation of a name and build a new principal instance.- Specified by:
parse
in interfaceX500DNHandler
- Parameters:
name
- the name string to parse- Returns:
- a new principal instance
-
parse
Parse the ASN.1 DER encoding representation of a name and build a new principal instance.- Specified by:
parse
in interfaceX500DNHandler
- Parameters:
name
- a distinguished name in ASN.1 DER encoded form- Returns:
- a new principal instance
-
clone
Clone the handler. Implementations which maintain instance-specific configuration data, etc, should implement this appropriately, possibly also implementingCloneable
.- Specified by:
clone
in interfaceX500DNHandler
- Overrides:
clone
in classObject
- Returns:
- the cloned handler
-