Package org.opensaml.security.x509
Class InternalX500DNHandler
- java.lang.Object
-
- org.opensaml.security.x509.InternalX500DNHandler
-
- All Implemented Interfaces:
X500DNHandler
public class InternalX500DNHandler extends Object implements X500DNHandler
Basic implementation ofX500DNHandlerwhich uses the internal built-in mechanisms provided byX500Principaldirectly.
-
-
Field Summary
-
Fields inherited from interface org.opensaml.security.x509.X500DNHandler
FORMAT_RFC1779, FORMAT_RFC2253
-
-
Constructor Summary
Constructors Constructor Description InternalX500DNHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description X500DNHandlerclone()Clone the handler.byte[]getEncoded(X500Principal principal)Returns the distinguished name in ASN.1 DER encoded form.StringgetName(X500Principal principal)Returns a string representation of the X.500 distinguished name using the default format as defined in the underlying implementation.StringgetName(X500Principal principal, String format)Returns a string representation of the X.500 distinguished name using the specified format.X500Principalparse(byte[] name)Parse the ASN.1 DER encoding representation of a name and build a new principal instance.X500Principalparse(String name)Parse the string representation of a name and build a new principal instance.
-
-
-
Method Detail
-
getEncoded
@Nonnull public byte[] getEncoded(@Nonnull X500Principal principal)Returns the distinguished name in ASN.1 DER encoded form.- Specified by:
getEncodedin interfaceX500DNHandler- Parameters:
principal- the principal name instance to serialize- Returns:
- the serialized name in ASN.1 DER encoded form
-
getName
@Nonnull public String getName(@Nonnull X500Principal principal)
Returns a string representation of the X.500 distinguished name using the default format as defined in the underlying implementation.- Specified by:
getNamein interfaceX500DNHandler- Parameters:
principal- the principal name instance to serialize- Returns:
- the serialized string name
-
getName
@Nonnull public String getName(@Nonnull X500Principal principal, @Nonnull String format)
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_RFC1779andX500DNHandler.FORMAT_RFC2253;- Specified by:
getNamein interfaceX500DNHandler- Parameters:
principal- the principal name instance to serializeformat- the format specifier of the resulting serialized string name- Returns:
- the serialized string name
-
parse
@Nonnull public X500Principal parse(@Nonnull String name)
Parse the string representation of a name and build a new principal instance.- Specified by:
parsein interfaceX500DNHandler- Parameters:
name- the name string to parse- Returns:
- a new principal instance
-
parse
@Nonnull public X500Principal parse(@Nonnull byte[] name)
Parse the ASN.1 DER encoding representation of a name and build a new principal instance.- Specified by:
parsein interfaceX500DNHandler- Parameters:
name- a distinguished name in ASN.1 DER encoded form- Returns:
- a new principal instance
-
clone
@Nonnull public X500DNHandler clone()
Clone the handler. Implementations which maintain instance-specific configuration data, etc, should implement this appropriately, possibly also implementingCloneable.- Specified by:
clonein interfaceX500DNHandler- Overrides:
clonein classObject- Returns:
- the cloned handler
-
-