aicas logoJamaica 3.2 release 62

org.ietf.jgss
Class Oid

java.lang.Object
  extended by org.ietf.jgss.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 GSSName name class contains public static Oid objects representing the standard name types defined in GSS-API.


Constructor Summary
Oid(byte[] derOid)
          Creates an Oid object from its DER encoding.
Oid(InputStream derOid)
          Creates an Oid object from its DER encoding.
Oid(String strOid)
          Creates an Oid object from a string representation of its integer components (e.g. "1.2.840.113554.1.2.2").
 
Method Summary
 boolean containedIn(Oid[] oids)
          A utility method to test if an Oid object is contained within the supplied Oid object array.
 boolean equals(Object o)
          equals compares this object to another object.
 byte[] getDER()
          Returns the full ASN.1 DER encoding for this oid object, which includes the tag and length.
 int hashCode()
          hashCode returns a hash code for this object.
 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").
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Oid

public Oid(String strOid)
    throws GSSException
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)
    throws GSSException
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)
    throws GSSException
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

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").

Overrides:
toString in class Object
Returns:
The string representation of this oid.

getDER

public byte[] getDER()
              throws GSSException
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.

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)
Description copied from class: Object
equals compares this object to another object.

Equals must be symmetric (a.equals(b) == b.equals(a)), reflexive (a.equals(a)==true) and transitive (a.equals(b) && b.equals(c) IMPLIES (a.equals(c))) and not change over time (a.equals(b) == a.equals(b)). a.equals(null) should always return false.

If a.equals(b) is true for two objects a and b, then a.hashCode()==b.hashCode() must hold.

The default implementation of equals returns this==other.

Overrides:
equals in class Object
Parameters:
o - the other object.
Returns:
if this and other are considered equal.

hashCode

public int hashCode()
Description copied from class: Object
hashCode returns a hash code for this object. The hash code must be equal for two objects a and b if a.equals(b) is true.

The default implementation returns System.identityHashCode(this).

Overrides:
hashCode in class Object
Returns:
a hash code value.

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.