|
Oracle Security Developer Tools Security Engine Java API Reference 10g Release 2 (10.1.2.0.2) B15569-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.crypto.cert.Entity
oracle.security.crypto.cert.X500Name
This class represents distinguished names as used in the X.500 series of specifications, defined in X.520.
A X500Name
is an Entity with support for some additional X.500 attributes. In addition to common name (which is the same as the entity name), the following attributes are supported using the old API methods: country, organization, organizational-unit, locality, state or province, and email. Using the new API methods, these as well as any other standard or custom attributes can be supported.
NB: It is an error to mix calls to methods used for definining attributes from both the old and new APIs.
This class implements hashCode
and equals
methods, and so may be used for keys in a hashtable.
Warning: The serialization capability of this class should only be used for short-term storage and RMI between applications running the same version of this product. It should not be relied on for long-term perisistence, as future versions of this class may use an incompatible serialization format. For now, applications requiring long-term persistence should use the ASN.1 encodings provided by the input(InputStream)
and output(OutputStream)
methods directly, instead of serialization.
X509
, X500RDN
, Serialized FormConstructor Summary | |
X500Name() Creates a new, empty X.500 name (one with no attributes). |
|
X500Name(java.io.InputStream is) |
|
X500Name(java.lang.String str) Parse an X.500 name from a string (e.g., one produced by toString ). |
Method Summary | |
void |
addComponent(ASN1ObjectID type, ASN1String value) Add the specified type-and-value pair to this X500Name as a new component. |
void |
addComponent(X500RDN rdn) Add the specified X500RDN to this X500Name as a new component. |
X500RDN |
componentAt(int i) |
java.util.Enumeration |
components() |
boolean |
equals(java.lang.Object o) Compares this X.500 name to the specified object. |
void |
forgetOriginalFormat() Deprecated. This method is no longer needed, as the X500Name class no longer remembers the original input string format, and calling it has no effect. |
X500RDN |
getAttribute(java.lang.String name) Returns the first X500RDN with the given attribute name. |
ASN1Object |
getAttributeValue(java.lang.String name) Gets the value for the first X500RDN with the given attribute name. |
java.lang.String |
getCommonName() |
java.util.Vector |
getComponents() |
java.lang.String |
getCountryName() |
java.lang.String |
getEmail() |
java.lang.String |
getLocalityName() |
java.lang.String |
getOrganizationName() |
java.lang.String |
getOrgUnitName() |
java.lang.String |
getStateName() |
int |
hashCode() |
void |
input(java.io.InputStream is) Initializes this X.500 name by reading its DER-encoding from the specified input stream. |
void |
input(java.lang.String s) Initializes this X.500 name by reading its description from the specified string. |
int |
length() |
void |
output(java.io.OutputStream os) Output to the specified output stream. |
void |
readExternal(java.io.ObjectInput is) |
void |
setAttr(java.lang.String name, java.lang.String value) Sets the attribute of this X.500 name indicated by the given string. |
void |
setCommonName(java.lang.String s) |
void |
setCountryName(java.lang.String s) |
void |
setEmail(java.lang.String s) |
void |
setLocalityName(java.lang.String s) |
void |
setOrganizationName(java.lang.String s) |
void |
setOrgUnitName(java.lang.String s) |
void |
setStateName(java.lang.String s) |
int |
size() |
java.lang.String |
toString() Returns a string representation of this X500Name . |
void |
writeExternal(java.io.ObjectOutput os) |
Methods inherited from class oracle.security.crypto.cert.Entity |
getName, initialize, save, setName |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public X500Name()
public X500Name(java.lang.String str)
toString
). The following notation is used: attr=value, attr=value, ...
There shall be no space around the equal sign or before the comma. A comma in the value
may be escaped using a backslash. The attribute names are case-insensitive. The following attribute names are supported: C
, ST
, L
, O
, OU
, CN
, EMAIL
.toString()
, equals(java.lang.Object)
public X500Name(java.io.InputStream is) throws java.io.IOException
Method Detail |
public void addComponent(X500RDN rdn)
X500RDN
to this X500Name
as a new component.public void addComponent(ASN1ObjectID type, ASN1String value)
X500Name
as a new component.for defined OIDs from the
id_at arc.public ASN1Object getAttributeValue(java.lang.String name)
X500RDN
with the given attribute name.name
- Code for which attribute to get (e.g. "C" for country name).ASN1String
value of the given attribute, or null
if it has not been defined.public X500RDN getAttribute(java.lang.String name)
X500RDN
with the given attribute name.name
- Code for which attribute to get (e.g. "C" for country name).X500RDN
with the given attribute name, or null
if it has not been defined.public void input(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public void input(java.lang.String s) throws InvalidFormatException
InvalidFormatException
- If the string is not the correct formatpublic void output(java.io.OutputStream os) throws java.io.IOException
Note: If the old API methods are used to define the attributes the the order of output is as follows: C, ST, L, O, OU, CN, EMAIL
.
java.io.IOException
public int length()
public java.lang.String toString()
X500Name
. The output of this method is suitable for use in the constructor X500Name(String)
. The order of entries is the reverse of the order produced by the output
method.X500Name(String)
, output(OutputStream)
public java.util.Vector getComponents()
public java.util.Enumeration components()
public int size()
public X500RDN componentAt(int i)
public java.lang.String getCountryName()
public void setCountryName(java.lang.String s)
public java.lang.String getStateName()
public void setStateName(java.lang.String s)
public java.lang.String getLocalityName()
public void setLocalityName(java.lang.String s)
public java.lang.String getOrganizationName()
public void setOrganizationName(java.lang.String s)
public java.lang.String getOrgUnitName()
public void setOrgUnitName(java.lang.String s)
public java.lang.String getCommonName()
public void setCommonName(java.lang.String s)
public java.lang.String getEmail()
public void setEmail(java.lang.String s)
public void setAttr(java.lang.String name, java.lang.String value)
public void forgetOriginalFormat()
X500Name
class no longer remembers the original input string format, and calling it has no effect.public boolean equals(java.lang.Object o)
Compares this X.500 name to the specified object. Returns true if and only if the argument is not null
, and represents the same X.500 name. For the purposes of this comparison operation, two X.500 names are considered the same if and only if all the attributes recognized by this implementation have the same value.
equals
in class Entity
public int hashCode()
public void writeExternal(java.io.ObjectOutput os) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput is) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
|
Oracle Security Developer Tools Security Engine Java API Reference 10g Release 2 (10.1.2.0.2) B15569-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |