com.sun.gssapi

Class Oid


public class Oid
extends java.lang.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

RFC 2078
  • gss_test_oid_set_member
  • gss_release_oid
  • gss_oid_to_str
  • gss_str_to_oid

Constructor Summary

Oid(InputStream derOid)
Constructs an Oid object from its DER encoding.
Oid(String strOid)
Constructs an Oid object from a string representation of its integer components.
Oid(byte[] DEROid)
Constructs an Oid object from its DER encoding.
Oid(byte[] data, int offset)
Constructs an Oid object from its DER encoding.

Method Summary

boolean
containedIn(Oid[] oids)
A utility method which takes an array of Oids and checks if it contains this oid object.
boolean
equals(Object Obj)
Equality test for oid objects.
byte[]
getDER()
Returns the full ASN.1 DER encoding for this oid object.
String
toRFC2078String()
Returns a string representation of the Oid's integer components in the format specified within RFC 2078.
String
toString()
Returns a string representation of the oid's integer components in dot separated notation.

Constructor Details

Oid

public Oid(InputStream derOid)
            throws GSSException
Constructs an Oid object from its DER encoding. The structure and encoding of Oids is defined in ISOIEC-8824 and ISOIEC-8825.
Parameters:
derOid - stream containing the DER encoded oid
Throws:
GSSException - may be thrown when the DER encoding does not follow the prescribed format.

Oid

public Oid(String strOid)
            throws GSSException
Constructs an Oid object from a string representation of its integer components. Will throw a GSSException if the string is improperly formatted.
Parameters:
strOid - the string in either of these two formats: "{1 2 3 3}" or "1.2.3.3".
Throws:
GSSException - may be thrown when the string is incorrectly formatted

Oid

public Oid(byte[] DEROid)
            throws GSSException
Constructs an Oid object from its DER encoding. The structure and encoding of Oids is defined in ISOIEC-8824 and ISOIEC-8825.
Parameters:
DEROid - a byte array containing the DER encoding of the Oid
Throws:
GSSException - may be thrown when the DER encoding does not follow the prescribed format.
See Also:
Oid.Oid(java.io.InputStream)

Oid

public Oid(byte[] data,
           int offset)
            throws GSSException
Constructs an Oid object from its DER encoding. The structure and encoding of Oids is defined in ISOIEC-8824 and ISOIEC-8825.
Parameters:
data - byte array containing the DER encoded oid
offset - where in the data byte array to start from
Throws:
GSSException - may be thrown when the DER encoding does not follow the prescribed format.

Method Details

containedIn

public boolean containedIn(Oid[] oids)
A utility method which takes an array of Oids and checks if it contains this oid object.

RFC 2078
Parameters:
Returns:
true if the array contains this object, false otherwise

equals

public boolean equals(Object Obj)
Equality test for oid objects.
Parameters:
Obj - Oid object that has to be compared to this one
Returns:
true if they represent the same Oid, false otherwise

getDER

public byte[] getDER()
            throws GSSException
Returns the full ASN.1 DER encoding for this oid object.
Returns:
byte array containing the DER encoding of this oid object.
Throws:
GSSException - may be thrown when the oid can't be encoded

toRFC2078String

public String toRFC2078String()
Returns a string representation of the Oid's integer components in the format specified within RFC 2078. For example { 1 2 3 4 }
RFC 2078
Returns:
string representation in the following format: { 1 2 3 4 5 }

toString

public String toString()
Returns a string representation of the oid's integer components in dot separated notation.
Returns:
string representation in the following format: "1.2.3.4.5"