APIdia Launch Partner
Top Description Fields Constructors Methods
org.ietf.jgss

public Class Oid

extends Object
Class Inheritance
Imports
java.io.InputStream, .IOException, sun.security.util.DerValue, .DerOutputStream, .ObjectIdentifier

This class represents Universal Object Identifiers (Oids) and their associated operations.

Oids are hierarchically globally-interpretable identifiers used within the GSS-API framework to identify mechanisms and name formats.

The structure and encoding of Oids is defined in ISOIEC-8824 and ISOIEC-8825. For example the Oid representation of Kerberos V5 mechanism is "1.2.840.113554.1.2.2"

The GSSName name class contains public static Oid objects representing the standard name types defined in GSS-API.

Author
Mayank Upadhyay
Since
1.4

Field Summary

Modifier and TypeField and Description
private byte[]
private final ObjectIdentifier

Constructor Summary

AccessConstructor and Description
public
Oid(String
the dot separated string representation of the oid. For instance, "1.2.840.113554.1.2.2".
strOid
)

Constructs an Oid object from a string representation of its integer components.

public
Oid(InputStream
stream containing the DER encoded oid
derOid
)

Creates an Oid object from its ASN.1 DER encoding.

public
Oid(byte[]
byte array containing the DER encoded oid
data
)

Creates an Oid object from its ASN.1 DER encoding.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the array contains this Oid value, false otherwise
containedIn
(Oid[]
the array of Oid's to search
oids
)

A utility method to test if this Oid value is contained within the supplied Oid array.

public boolean

Returns:

true if the two Oid objects represent the same value, false otherwise.
equals
(Object
the Oid object that has to be compared to this one
other
)

Overrides java.lang.Object.equals.

Tests if two Oid objects represent the same Object identifier value.

public byte[]

Returns:

byte array containing the DER encoding of this oid object.
getDER
()

Returns the full ASN.1 DER encoding for this oid object, which includes the tag and length.

pack-priv static Oid
getInstance(String strOid)

Only for calling by initializators used with declarations.

public int

Returns:

a hashcode value for this Oid
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hashcode value for this Oid.

public String

Returns:

string representation in the following format: "1.2.3.4.5"
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the oid's integer components in dot separated notation.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

derEncodingback to summary
private byte[] derEncoding
oidback to summary
private final ObjectIdentifier oid

Constructor Detail

Oidback to summary
public Oid(String strOid) throws GSSException

Constructs an Oid object from a string representation of its integer components.

Parameters
strOid:String

the dot separated string representation of the oid. For instance, "1.2.840.113554.1.2.2".

Exceptions
GSSException:
may be thrown when the string is incorrectly formatted
Oidback to summary
public Oid(InputStream derOid) throws GSSException

Creates an Oid object from its ASN.1 DER encoding. This refers to the full encoding including tag and length. The structure and encoding of Oids is defined in ISOIEC-8824 and ISOIEC-8825. This method is identical in functionality to its byte array counterpart.

Parameters
derOid:InputStream

stream containing the DER encoded oid

Exceptions
GSSException:
may be thrown when the DER encoding does not follow the prescribed format.
Oidback to summary
public Oid(byte[] data) throws GSSException

Creates an Oid object from its ASN.1 DER encoding. This refers to the full encoding including tag and length. The structure and encoding of Oids is defined in ISOIEC-8824 and ISOIEC-8825. This method is identical in functionality to its InputStream counterpart.

Parameters
data:byte[]

byte array containing the DER encoded oid

Exceptions
GSSException:
may be thrown when the DER encoding does not follow the prescribed format.

Method Detail

containedInback to summary
public boolean containedIn(Oid[] oids)

A utility method to test if this Oid value is contained within the supplied Oid array.

Parameters
oids:Oid[]

the array of Oid's to search

Returns:boolean

true if the array contains this Oid value, false otherwise

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Tests if two Oid objects represent the same Object identifier value.

Parameters
other:Object

the Oid object that has to be compared to this one

Returns:boolean

true if the two Oid objects represent the same value, false otherwise.

Annotations
@Override
getDERback to summary
public byte[] getDER() throws GSSException

Returns the full ASN.1 DER encoding for this oid object, which includes the tag and length.

Returns:byte[]

byte array containing the DER encoding of this oid object.

Exceptions
GSSException:
may be thrown when the oid can't be encoded
getInstanceback to summary
pack-priv static Oid getInstance(String strOid)

Only for calling by initializators used with declarations.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hashcode value for this Oid.

Returns:int

a hashcode value for this Oid

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of the oid's integer components in dot separated notation.

Returns:String

string representation in the following format: "1.2.3.4.5"