All Packages Class Hierarchy This Package Previous Next Index
Class netscape.security.x509.X500Name
netscape.security.x509.X500Name
- public class X500Name
- implements GeneralNameInterface
X.500 names are used to identify entities, such as those which are
identified by X.509 certificates. They are world-wide, hierarchical,
and descriptive. Entities can be identified by attributes, and in
some systems can be searched for according to those attributes.
This class exposes only partial X.500 name functionality. Most
notably, it works best if Relative Distinguished Names only have one
(unique) attribute each, and if only the most common attributes need
to be visible to applications. This limitation, and others, will
be lifted over time.
- See Also:
- GeneralName, GeneralNames, GeneralNameInterface, RDN, AVA, LdapDNStrConverter
-
commonName_oid
- OID for the "CN=" attribute, denoting a person's common name.
-
countryName_oid
- OID for the "C=" attribute, denoting a country.
-
email_oid
- OID for the "E=" attribute, denoting a person's email address.
-
ipAddress_oid
- OID for "IP=" IP address attributes, used with SKIP.
-
localityName_oid
- OID for the "L=" attribute, denoting a locality (such as a city)
-
orgName_oid
- OID for the "O=" attribute, denoting an organization name
-
orgUnitName_oid
- OID for the "OU=" attribute, denoting an organizational unit name
-
stateName_oid
- OID for the "S=" attribute, denoting a state (such as Delaware)
-
streetAddress_oid
- OID for the "STREET=" attribute, denoting a street address.
-
title_oid
- OID for the "T=" attribute, denoting a person's title.
-
X500Name(byte[])
- Constructs a name from an ASN.1 encoded byte array.
-
X500Name(DerInputStream)
- Constructs a name from an ASN.1 encoded input stream.
-
X500Name(DerValue)
- Constructs a name from an ASN.1 encoded value.
-
X500Name(RDN[])
- Constructs a X500Name from array of RDN.
-
X500Name(String)
- Constructs a name from a Ldap DN string, such
as &lb;CN=Dave, OU=JavaSoft, O=Sun Microsystems, C=US&rb;.
-
X500Name(String, LdapDNStrConverter)
- Constructs a X500Name from a Ldap DN String using the specified
LdapDNStrConverter.
-
X500Name(String, String, String, String)
- Constructs a X500Name from fields common in enterprise application
environments.
-
X500Name(String, String, String, String, String, String)
- Constructs a X500Name from fields common in Internet application
environments.
-
X500Name(Vector)
- convenience method.
-
encode(DerOutputStream)
- Encodes the name in DER-encoded form.
-
equals(X500Name)
- Compares this name with another, for equality.
-
getCommonName()
- Returns a "Common Name" component.
-
getCountry()
- Returns a "Country" name component.
-
getEmail()
- Returns a "Email" name component.
-
getEncoded()
- Gets the name in DER-encoded form.
-
getLocality()
- Returns a "Locality" name component.
-
getName()
- Returns the value of toString().
-
getNames()
- Returns an array of RDN in the X500Name.
-
getNamesLength()
- Returns the number of RDNs in the X500Name.
-
getOrganization()
- Returns an "Organization" name component.
-
getOrganizationalUnit()
- Returns an "Organizational Unit" name component.
-
getRDNs()
- Returns an enumerator of RDNs in the X500Name.
-
getState()
- Returns a "State" name component.
-
getType()
- Return type of GeneralName.
-
toLdapDNString()
- Returns a Ldap DN String from the X500Name using the global default
LdapDNStrConverter
-
toLdapDNString(LdapDNStrConverter)
- Returns a Ldap DN String from the X500Name
using the specified LdapDNStrconverter.
-
toString()
- Returns a Ldap DN string, using the global default LdapDNStrConverter
or null if an error occurs in the conversion.
commonName_oid
public static final ObjectIdentifier commonName_oid
- OID for the "CN=" attribute, denoting a person's common name.
countryName_oid
public static final ObjectIdentifier countryName_oid
- OID for the "C=" attribute, denoting a country.
localityName_oid
public static final ObjectIdentifier localityName_oid
- OID for the "L=" attribute, denoting a locality (such as a city)
orgName_oid
public static final ObjectIdentifier orgName_oid
- OID for the "O=" attribute, denoting an organization name
orgUnitName_oid
public static final ObjectIdentifier orgUnitName_oid
- OID for the "OU=" attribute, denoting an organizational unit name
stateName_oid
public static final ObjectIdentifier stateName_oid
- OID for the "S=" attribute, denoting a state (such as Delaware)
streetAddress_oid
public static final ObjectIdentifier streetAddress_oid
- OID for the "STREET=" attribute, denoting a street address.
title_oid
public static final ObjectIdentifier title_oid
- OID for the "T=" attribute, denoting a person's title.
email_oid
public static final ObjectIdentifier email_oid
- OID for the "E=" attribute, denoting a person's email address.
ipAddress_oid
public static final ObjectIdentifier ipAddress_oid
- OID for "IP=" IP address attributes, used with SKIP.
X500Name
public X500Name(String ldapDNString) throws IOException
- Constructs a name from a Ldap DN string, such
as &lb;CN=Dave, OU=JavaSoft, O=Sun Microsystems, C=US&rb;. The
older "/C=US/O=Sun Microsystems, Inc/OU=JavaSoft/CN=Dave" syntax
is not currently supported. (The former is RFC 1779 style.)
- Parameters:
- ldapDNString - a Ldap DN String e.g. as defined in RFC1779
X500Name
public X500Name(String ldapDNString,
LdapDNStrConverter ldapDNStrConverter) throws IOException
- Constructs a X500Name from a Ldap DN String using the specified
LdapDNStrConverter.
- Parameters:
- ldapDNString - a Ldap DN String e.g. as defined in RFC1779.
- ldapDNStrConverter - A LdapDNStrConverter
- See Also:
- LdapDNStrConverter
X500Name
public X500Name(String commonName,
String organizationUnit,
String organizationName,
String country) throws IOException
- Constructs a X500Name from fields common in enterprise application
environments.
- Parameters:
- commonName - common name of a person, e.g. "Vivette Davis"
- organizationUnit - small organization name, e.g. "Purchasing"
- organizationName - large organization name, e.g. "Onizuka, Inc."
- country - two letter country code, e.g. "CH"
X500Name
public X500Name(String commonName,
String organizationUnit,
String organizationName,
String localityName,
String stateName,
String country) throws IOException
- Constructs a X500Name from fields common in Internet application
environments.
- Parameters:
- commonName - common name of a person, e.g. "Vivette Davis"
- organizationUnit - small organization name, e.g. "Purchasing"
- organizationName - large organization name, e.g. "Onizuka, Inc."
- localityName - locality (city) name, e.g. "Palo Alto"
- stateName - state name, e.g. "California"
- country - two letter country code, e.g. "CH"
X500Name
public X500Name(DerValue value) throws IOException
- Constructs a name from an ASN.1 encoded value. The encoding
of the name in the stream uses DER (a BER/1 subset).
- Parameters:
- value - a DER-encoded value holding an X.500 name.
X500Name
public X500Name(DerInputStream in) throws IOException
- Constructs a name from an ASN.1 encoded input stream. The encoding
of the name in the stream uses DER (a BER/1 subset).
- Parameters:
- in - DER-encoded data holding an X.500 name.
X500Name
public X500Name(byte name[]) throws IOException
- Constructs a name from an ASN.1 encoded byte array.
- Parameters:
- name - DER-encoded byte array holding an X.500 name.
X500Name
public X500Name(RDN rdns[]) throws IOException
- Constructs a X500Name from array of RDN. The RDNs are expected to
be in big endian order i.e. most significant first.
- Parameters:
- rdns - an array of RDN.
X500Name
public X500Name(Vector rdnVector) throws IOException
- convenience method.
- Parameters:
- rdns - a vector of rdns.
equals
public synchronized boolean equals(X500Name other)
- Compares this name with another, for equality.
- Returns:
- true iff the names are identical.
getType
public int getType()
- Return type of GeneralName.
getCountry
public String getCountry() throws IOException
- Returns a "Country" name component. If more than one
such attribute exists, the topmost one is returned.
- Returns:
- "C=" component of the name, if any.
getOrganization
public String getOrganization() throws IOException
- Returns an "Organization" name component. If more than
one such attribute exists, the topmost one is returned.
- Returns:
- "O=" component of the name, if any.
getOrganizationalUnit
public String getOrganizationalUnit() throws IOException
- Returns an "Organizational Unit" name component. If more
than one such attribute exists, the topmost one is returned.
- Returns:
- "OU=" component of the name, if any.
getCommonName
public String getCommonName() throws IOException
- Returns a "Common Name" component. If more than one such
attribute exists, the topmost one is returned.
- Returns:
- "CN=" component of the name, if any.
getLocality
public String getLocality() throws IOException
- Returns a "Locality" name component. If more than one
such component exists, the topmost one is returned.
- Returns:
- "L=" component of the name, if any.
getState
public String getState() throws IOException
- Returns a "State" name component. If more than one
such component exists, the topmost one is returned.
- Returns:
- "S=" component of the name, if any.
getEmail
public String getEmail() throws IOException
- Returns a "Email" name component. If more than one
such component exists, the topmost one is returned.
- Returns:
- "E=" component of the name, if any.
toLdapDNString
public String toLdapDNString() throws IOException
- Returns a Ldap DN String from the X500Name using the global default
LdapDNStrConverter
- Returns:
- Ldap DN string of this X500Name using the default converter.
- See Also:
- LdapDNStrConverter
toLdapDNString
public String toLdapDNString(LdapDNStrConverter ldapDNStrConverter) throws IOException
- Returns a Ldap DN String from the X500Name
using the specified LdapDNStrconverter.
For example, RFC1779String converter can be passed to convert the
DN to RFC1779 string syntax.
- Parameters:
- ldapDNStrConverter - a LdapDNStrConverter
- Returns:
- Ldap DN string of the X500Name
- See Also:
- LdapDNStrConverter
toString
public String toString()
- Returns a Ldap DN string, using the global default LdapDNStrConverter
or null if an error occurs in the conversion.
getName
public String getName()
- Returns the value of toString(). This call is needed to
implement the java.security.Principal interface.
getRDNs
public Enumeration getRDNs()
- Returns an enumerator of RDNs in the X500Name.
- Returns:
- enumeration of rdns in this X500Name.
getNames
public RDN[] getNames()
- Returns an array of RDN in the X500Name.
- Returns:
- array of RDN in this X500name.
getNamesLength
public int getNamesLength()
- Returns the number of RDNs in the X500Name.
- Returns:
- number of RDNs in this X500Name.
encode
public void encode(DerOutputStream out) throws IOException
- Encodes the name in DER-encoded form.
- Parameters:
- out - where to put the DER-encoded X.500 name
getEncoded
public byte[] getEncoded() throws IOException
- Gets the name in DER-encoded form.
- Returns:
- the DER encoded byte array of this name,
null if no names are present.
All Packages Class Hierarchy This Package Previous Next Index