public class

OtherName

extends Object
implements GeneralNameInterface
java.lang.Object
   ↳ sun.security.x509.OtherName

Class Overview

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
 }
 

Summary

[Expand]
Inherited Constants
From interface sun.security.x509.GeneralNameInterface
Public Constructors
OtherName(ObjectIdentifier oid, byte[] value)
Create the OtherName object from a passed ObjectIdentfier and byte array name value
OtherName(DerValue derValue)
Create the OtherName object from the passed encoded Der value.
Public Methods
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 hashCode()
Returns the hash code for this OtherName.
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface sun.security.x509.GeneralNameInterface

Public Constructors

public OtherName (ObjectIdentifier oid, byte[] value)

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

public OtherName (DerValue derValue)

Create the OtherName object from the passed encoded Der value.

Parameters
derValue the encoded DER OtherName.
Throws
IOException on error.

Public Methods

public 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. does not constrain).
  • NAME_MATCH = 0: input name matches name.
  • NAME_NARROWS = 1: input name narrows name (is lower in the naming subtree)
  • NAME_WIDENS = 2: input name widens name (is higher in the naming subtree)
  • NAME_SAME_TYPE = 3: input name does not match or narrow name, but is same type.
. These results are used in checking NameConstraints during certification path verification.

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.

public void encode (DerOutputStream out)

Encode the Other name into the DerOutputStream.

Parameters
out the DER stream to encode the Other-Name to.
Throws
IOException on encoding errors.

public boolean equals (Object other)

Compares this name with another, for equality.

Parameters
other the reference object with which to compare.
Returns
  • true iff the names are identical.

public byte[] getNameValue ()

Get name value

public ObjectIdentifier getOID ()

Get ObjectIdentifier

public int getType ()

Return the type of the GeneralName.

public int hashCode ()

Returns the hash code for this OtherName.

Returns
  • a hash code value.

public int subtreeDepth ()

Return subtree depth of this name for purposes of determining NameConstraints minimum and maximum bounds.

Throws
UnsupportedOperationException if not supported for this name type

public String toString ()

Convert the name into user readable string.

Returns
  • a string representation of the object.