sun.security.x509
Class OtherName

java.lang.Object
  extended by sun.security.x509.OtherName
All Implemented Interfaces:
GeneralNameInterface

public class OtherName
extends Object
implements GeneralNameInterface

This class represents the OtherName as required by the GeneralNames ASN.1 object. It supplies the generic framework to allow specific Other Name types, and also provides minimal support for unrecognized Other Name types. The ASN.1 definition for OtherName is:

 OtherName ::= SEQUENCE {
     type-id    OBJECT IDENTIFIER,
     value      [0] EXPLICIT ANY DEFINED BY type-id
 }
 


Field Summary
 
Fields inherited from interface sun.security.x509.GeneralNameInterface
NAME_ANY, NAME_DIFF_TYPE, NAME_DIRECTORY, NAME_DNS, NAME_EDI, NAME_IP, NAME_MATCH, NAME_NARROWS, NAME_OID, NAME_RFC822, NAME_SAME_TYPE, NAME_URI, NAME_WIDENS, NAME_X400
 
Constructor Summary
OtherName(DerValue derValue)
          Create the OtherName object from the passed encoded Der value.
OtherName(ObjectIdentifier oid, byte[] value)
          Create the OtherName object from a passed ObjectIdentfier and byte array name value
 
Method Summary
 int constrains(GeneralNameInterface inputName)
          Return type of constraint inputName places on this name: NAME_DIFF_TYPE = -1: input name is different type from name (i.e.
 void encode(DerOutputStream out)
          Encode the Other name into the DerOutputStream.
 boolean equals(Object other)
          Compares this name with another, for equality.
 byte[] getNameValue()
          Get name value
 ObjectIdentifier getOID()
          Get ObjectIdentifier
 int getType()
          Return the type of the GeneralName.
 int subtreeDepth()
          Return subtree depth of this name for purposes of determining NameConstraints minimum and maximum bounds.
 String toString()
          Convert the name into user readable string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OtherName

public OtherName(ObjectIdentifier oid,
                 byte[] value)
          throws IOException
Create the OtherName object from a passed ObjectIdentfier and byte array name value

Parameters:
oid - ObjectIdentifier of this OtherName object
value - the DER-encoded value of the OtherName
Throws:
IOException - on error

OtherName

public OtherName(DerValue derValue)
          throws IOException
Create the OtherName object from the passed encoded Der value.

Parameters:
derValue - the encoded DER OtherName.
Throws:
IOException - on error.
Method Detail

getOID

public ObjectIdentifier getOID()
Get ObjectIdentifier


getNameValue

public byte[] getNameValue()
Get name value


getType

public int getType()
Return the type of the GeneralName.

Specified by:
getType in interface GeneralNameInterface

encode

public void encode(DerOutputStream out)
            throws IOException
Encode the Other name into the DerOutputStream.

Specified by:
encode in interface GeneralNameInterface
Parameters:
out - the DER stream to encode the Other-Name to.
Throws:
IOException - on encoding errors.

equals

public boolean equals(Object other)
Compares this name with another, for equality.

Overrides:
equals in class Object
Parameters:
other - the reference object with which to compare.
Returns:
true iff the names are identical.
See Also:
Object.hashCode(), Hashtable

toString

public String toString()
Convert the name into user readable string.

Overrides:
toString in class Object
Returns:
a string representation of the object.

constrains

public int constrains(GeneralNameInterface inputName)
Return type of constraint inputName places on this name:. These results are used in checking NameConstraints during certification path verification.

Specified by:
constrains in interface GeneralNameInterface
Parameters:
inputName - to be checked for being constrained
Throws:
UnsupportedOperationException - if name is same type, but comparison operations are not supported for this name type.

subtreeDepth

public int subtreeDepth()
Return subtree depth of this name for purposes of determining NameConstraints minimum and maximum bounds.

Specified by:
subtreeDepth in interface GeneralNameInterface
Throws:
UnsupportedOperationException - if not supported for this name type