Package com.sun.gssapi
Class Oid
java.lang.Object
com.sun.gssapi.Oid
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
- This class replaces the following GSS-API functions:
- gss_test_oid_set_member
- gss_release_oid
- gss_oid_to_str
- gss_str_to_oid
-
Constructor Summary
ConstructorsConstructorDescriptionOid
(byte[] DEROid) Constructs an Oid object from its DER encoding.Oid
(byte[] data, int offset) Constructs an Oid object from its DER encoding.Oid
(InputStream derOid) Constructs an Oid object from its DER encoding.Constructs an Oid object from a string representation of its integer components. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containedIn
(Oid[] oids) A utility method which takes an array of Oids and checks if it contains this oid object.boolean
Equality test for oid objects.byte[]
getDER()
Returns the full ASN.1 DER encoding for this oid object.Returns a string representation of the Oid's integer components in the format specified within RFC 2078.toString()
Returns a string representation of the oid's integer components in dot separated notation.
-
Constructor Details
-
Oid
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
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
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 oidoffset
- where in the data byte array to start from- Throws:
GSSException
- may be thrown when the DER encoding does not follow the prescribed format.
-
Oid
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:
-
-
Method Details
-
toString
Returns a string representation of the oid's integer components in dot separated notation. -
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
- equivalent to gss_oid_to_str
- Returns:
- string representation in the following format: { 1 2 3 4 5 }
- See Also:
-
equals
Equality test for oid objects. -
getDER
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
-
containedIn
A utility method which takes an array of Oids and checks if it contains this oid object.- RFC 2078
- In the JGSS package Oid sets are represented as arrays of Oids. This method is equivalent to gss_test_oid_set_member.
- Parameters:
An
- array of Oids to search- Returns:
- true if the array contains this object, false otherwise
-