org.ietf.jgss

Class Oid

public class Oid extends Object

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 {@link GSSName} name class contains public static Oid objects representing the standard name types defined in GSS-API.

Constructor Summary
Oid(String strOid)
Creates an Oid object from a string representation of its integer components (e.g.
Oid(InputStream derOid)
Creates an Oid object from its DER encoding.
Oid(byte[] derOid)
Creates an Oid object from its DER encoding.
Method Summary
booleancontainedIn(Oid[] oids)
A utility method to test if an Oid object is contained within the supplied Oid object array.
booleanequals(Object o)
byte[]getDER()
Returns the full ASN.1 DER encoding for this oid object, which includes the tag and length.
inthashCode()
StringtoString()
Returns a string representation of the oid's integer components in dot separated notation (e.g.

Constructor Detail

Oid

public Oid(String strOid)
Creates an Oid object from a string representation of its integer components (e.g. "1.2.840.113554.1.2.2").

Parameters: strOid The string representation for the oid.

Throws: GSSException If the argument is badly formed.

Oid

public Oid(InputStream derOid)
Creates an Oid object from its 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 Stream containing the DER encoded oid.

Throws: GSSException If the DER stream is badly formed, or if the input stream throws an exception.

Oid

public Oid(byte[] derOid)
Creates an Oid object from its 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 streaming counterpart.

Parameters: derOid Byte array storing a DER encoded oid.

Throws: GSSException If the DER bytes are badly formed.

Method Detail

containedIn

public boolean containedIn(Oid[] oids)
A utility method to test if an Oid object is contained within the supplied Oid object array.

Parameters: oids An array of oids to search.

Returns: True if this oid is contained in the given array.

equals

public boolean equals(Object o)

getDER

public byte[] getDER()
Returns the full ASN.1 DER encoding for this oid object, which includes the tag and length.

Returns: The ASN.1 DER encoding for this oid.

Throws: GSSException If encoding fails.

hashCode

public int hashCode()

toString

public String toString()
Returns a string representation of the oid's integer components in dot separated notation (e.g. "1.2.840.113554.1.2.2").

Returns: The string representation of this oid.