APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.x509

public Class OtherName

extends Object
implements GeneralNameInterface
Class Inheritance
All Implemented Interfaces
sun.security.x509.GeneralNameInterface, sun.security.util.DerEncoder
Imports
java.io.IOException, java.lang.reflect.Constructor, java.util.Arrays, sun.security.util.*

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
}
Author
Hemma Prafullchandra

Field Summary

Modifier and TypeField and Description
private final GeneralNameInterface
private int
private final String
private final byte[]
private final ObjectIdentifier
private static final byte

Constructor Summary

AccessConstructor and Description
public
OtherName(ObjectIdentifier
ObjectIdentifier of this OtherName object
oid
,
byte[]
the DER-encoded value of the OtherName
value
)

Create the OtherName object from a passed ObjectIdentifier and byte array name value

public
OtherName(DerValue
the encoded DER OtherName.
derValue
)

Create the OtherName object from the passed encoded Der value.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

constraint type above
constrains
(GeneralNameInterface
to be checked for being constrained
inputName
)

Implements sun.security.x509.GeneralNameInterface.constrains.

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.
public void
encode(DerOutputStream
the DER stream to encode the Other-Name to.
out
)

Implements sun.security.util.DerEncoder.encode.

Encode the Other name into the DerOutputStream.

public boolean

Returns:

true iff the names are identical.
equals
(Object other)

Overrides java.lang.Object.equals.

Compares this name with another, for equality.

private GeneralNameInterface
getGNI(ObjectIdentifier oid, byte[] nameValue)

Get GeneralNameInterface

public byte[]
getNameValue()

Get name value

public ObjectIdentifier
getOID()

Get ObjectIdentifier

public int
getType()

Implements sun.security.x509.GeneralNameInterface.getType.

Return the type of the GeneralName.

public int

Returns:

the hash code for this OtherName
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code for this OtherName.

public int

Returns:

distance of name from root
subtreeDepth
()

Implements sun.security.x509.GeneralNameInterface.subtreeDepth.

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

public String
toString()

Overrides java.lang.Object.toString.

Convert the name into user readable string.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

gniback to summary
private final GeneralNameInterface gni
myhashback to summary
private int myhash
nameback to summary
private final String name
nameValueback to summary
private final byte[] nameValue
oidback to summary
private final ObjectIdentifier oid
TAG_VALUEback to summary
private static final byte TAG_VALUE

Constructor Detail

OtherNameback to summary
public OtherName(ObjectIdentifier oid, byte[] value) throws IOException

Create the OtherName object from a passed ObjectIdentifier and byte array name value

Parameters
oid:ObjectIdentifier

ObjectIdentifier of this OtherName object

value:byte[]

the DER-encoded value of the OtherName

Exceptions
IOException:
on error
OtherNameback to summary
public OtherName(DerValue derValue) throws IOException

Create the OtherName object from the passed encoded Der value.

Parameters
derValue:DerValue

the encoded DER OtherName.

Exceptions
IOException:
on error.

Method Detail

constrainsback to summary
public int constrains(GeneralNameInterface inputName)

Implements sun.security.x509.GeneralNameInterface.constrains.

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:GeneralNameInterface

to be checked for being constrained

Returns:int

constraint type above

Exceptions
UnsupportedOperationException:
if name is same type, but comparison operations are not supported for this name type.
encodeback to summary
public void encode(DerOutputStream out)

Implements sun.security.util.DerEncoder.encode.

Encode the Other name into the DerOutputStream.

Parameters
out:DerOutputStream

the DER stream to encode the Other-Name to.

Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Compares this name with another, for equality.

Returns:boolean

true iff the names are identical.

Annotations
@Override
getGNIback to summary
private GeneralNameInterface getGNI(ObjectIdentifier oid, byte[] nameValue) throws IOException

Get GeneralNameInterface

getNameValueback to summary
public byte[] getNameValue()

Get name value

getOIDback to summary
public ObjectIdentifier getOID()

Get ObjectIdentifier

getTypeback to summary
public int getType()

Implements sun.security.x509.GeneralNameInterface.getType.

Return the type of the GeneralName.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code for this OtherName.

Returns:int

the hash code for this OtherName

Annotations
@Override
subtreeDepthback to summary
public int subtreeDepth()

Implements sun.security.x509.GeneralNameInterface.subtreeDepth.

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

Returns:int

distance of name from root

Exceptions
UnsupportedOperationException:
if not supported for this name type
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Convert the name into user readable string.