org.opensaml.xml.security.x509
Interface X500DNHandler

All Known Implementing Classes:
InternalX500DNHandler

public interface X500DNHandler

Interface for implementations which handle parsing and serialization of X.500 names represented by X500Principal.


Field Summary
static java.lang.String FORMAT_RFC1779
          Specifies the string format specified in RFC 1779.
static java.lang.String FORMAT_RFC2253
          Specifies the string format specified in RFC 2253.
 
Method Summary
 X500DNHandler clone()
          Clone the handler.
 byte[] getEncoded(javax.security.auth.x500.X500Principal principal)
          Returns the distinguished name in ASN.1 DER encoded form.
 java.lang.String getName(javax.security.auth.x500.X500Principal principal)
          Returns a string representation of the X.500 distinguished name using the default format as defined in the underlying implementation.
 java.lang.String getName(javax.security.auth.x500.X500Principal principal, java.lang.String format)
          Returns a string representation of the X.500 distinguished name using the specified format.
 javax.security.auth.x500.X500Principal parse(byte[] name)
          Parse the ASN.1 DER encoding representation of a name and build a new principal instance.
 javax.security.auth.x500.X500Principal parse(java.lang.String name)
          Parse the string representation of a name and build a new principal instance.
 

Field Detail

FORMAT_RFC1779

static final java.lang.String FORMAT_RFC1779
Specifies the string format specified in RFC 1779.

See Also:
Constant Field Values

FORMAT_RFC2253

static final java.lang.String FORMAT_RFC2253
Specifies the string format specified in RFC 2253.

See Also:
Constant Field Values
Method Detail

parse

javax.security.auth.x500.X500Principal parse(java.lang.String name)
Parse the string representation of a name and build a new principal instance.

Parameters:
name - the name string to parse
Returns:
a new principal instance
Throws:
java.lang.IllegalArgumentException - if the name value can not be parsed by the implementation

parse

javax.security.auth.x500.X500Principal parse(byte[] name)
Parse the ASN.1 DER encoding representation of a name and build a new principal instance.

Parameters:
name - a distinguished name in ASN.1 DER encoded form
Returns:
a new principal instance
Throws:
java.lang.IllegalArgumentException - if the name value can not be parsed by the implementation

getName

java.lang.String getName(javax.security.auth.x500.X500Principal principal)
Returns a string representation of the X.500 distinguished name using the default format as defined in the underlying implementation.

Parameters:
principal - the principal name instance to serialize
Returns:
the serialized string name

getName

java.lang.String getName(javax.security.auth.x500.X500Principal principal,
                         java.lang.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 FORMAT_RFC1779 and FORMAT_RFC2253;

Parameters:
principal - the principal name instance to serialize
format - the format specifier of the resulting serialized string name
Returns:
the serialized string name
Throws:
java.lang.IllegalArgumentException - if the specified format is not understood by the implementation

getEncoded

byte[] getEncoded(javax.security.auth.x500.X500Principal principal)
Returns the distinguished name in ASN.1 DER encoded form.

Parameters:
principal - the principal name instance to serialize
Returns:
the serialized name in ASN.1 DER encoded form

clone

X500DNHandler clone()
Clone the handler. Implementations which maintain instance-specific configuration data, etc, should implement this appropriately, possibly also implementing Cloneable.

Returns:
the cloned handler


Copyright © 2006-2010 Internet2. All Rights Reserved.