public class Oid
extends java.lang.Object
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
Constructor and Description |
---|
Oid(byte[] DEROid)
Constructs an Oid object from its DER encoding.
|
Oid(byte[] data,
int offset)
Constructs an Oid object from its DER encoding.
|
Oid(java.io.InputStream derOid)
Constructs an Oid object from its DER encoding.
|
Oid(java.lang.String strOid)
Constructs an Oid object from a string representation of its
integer components.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containedIn(Oid[] oids)
A utility method which takes an array of Oids and checks if
it contains this oid object.
|
boolean |
equals(java.lang.Object Obj)
Equality test for oid objects.
|
byte[] |
getDER()
Returns the full ASN.1 DER encoding for this oid object.
|
java.lang.String |
toRFC2078String()
Returns a string representation of the Oid's integer components
in the format specified within RFC 2078.
|
java.lang.String |
toString()
Returns a string representation of the oid's integer components
in dot separated notation.
|
public Oid(java.lang.String strOid) throws GSSException
strOid
- the string in either of these two formats:
"{1 2 3 3}" or "1.2.3.3".GSSException
- may be thrown when the
string is incorrectly formattedpublic Oid(java.io.InputStream derOid) throws GSSException
derOid
- stream containing the DER encoded oidGSSException
- may be thrown when the DER
encoding does not follow the prescribed format.public Oid(byte[] data, int offset) throws GSSException
data
- byte array containing the DER encoded oidoffset
- where in the data byte array to start fromGSSException
- may be thrown when the DER
encoding does not follow the prescribed format.public Oid(byte[] DEROid) throws GSSException
DEROid
- a byte array containing the DER encoding of the OidGSSException
- may be thrown when the DER
encoding does not follow the prescribed format.Oid(java.io.InputStream)
public java.lang.String toString()
toString
in class java.lang.Object
toRFC2078String()
public java.lang.String toRFC2078String()
toString()
public boolean equals(java.lang.Object Obj)
equals
in class java.lang.Object
Obj
- Oid object that has to be compared to this onepublic byte[] getDER() throws GSSException
GSSException
- may be thrown when the oid can't be encodedpublic boolean containedIn(Oid[] oids)
An
- array of Oids to search