Class InternalX500DNHandler

java.lang.Object
org.opensaml.security.x509.InternalX500DNHandler
All Implemented Interfaces:
X500DNHandler

public class InternalX500DNHandler extends Object implements X500DNHandler
Basic implementation of X500DNHandler which uses the internal built-in mechanisms provided by X500Principal directly.
  • Constructor Details

    • InternalX500DNHandler

      public InternalX500DNHandler()
  • Method Details

    • getEncoded

      @Nonnull public byte[] getEncoded(@Nonnull X500Principal principal)
      Returns the distinguished name in ASN.1 DER encoded form.
      Specified by:
      getEncoded in interface X500DNHandler
      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:
      getName in interface X500DNHandler
      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 as X500DNHandler.FORMAT_RFC1779 and X500DNHandler.FORMAT_RFC2253;
      Specified by:
      getName in interface X500DNHandler
      Parameters:
      principal - the principal name instance to serialize
      format - 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:
      parse in interface X500DNHandler
      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:
      parse in interface X500DNHandler
      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 implementing Cloneable.
      Specified by:
      clone in interface X500DNHandler
      Overrides:
      clone in class Object
      Returns:
      the cloned handler