|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openorb.orb.csiv2.ASN1Utils
public final class ASN1Utils
Helper methods to encode and decode various ASN1 constructs.
Method Summary | |
---|---|
static boolean |
decodeGSSUPToken(org.omg.IOP.Codec codec,
byte[] token_arr,
InitialContextToken gssup_tok)
Decode an GSSUP InitialContextToken from a GSSToken. |
static java.lang.String |
decodeObjectIdentifier(byte[] arr)
Decode an oid from the ASN representation (byte array) into a human readable string format. |
static byte[] |
encodeGSSUPToken(org.omg.CORBA.ORB orb,
org.omg.IOP.Codec codec,
java.lang.String user,
char[] pwd,
java.lang.String target)
Encode a mechanism independent initial context token (GSSToken). |
static byte[] |
encodeObjectIdentifier(java.lang.String oid)
Encode an oid from a stringified representation into ASN format (byte array). |
static byte[] |
gssExportName(java.lang.String oid,
java.lang.String name)
This method encodes a name as if it was encoded using the GSS-API gss_export_name() function call (see RFC 2743, page 84). |
static java.lang.String |
gssImportName(byte[] name_tok)
This function reads a name from a byte array which was created by the gssExportName() method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static byte[] encodeObjectIdentifier(java.lang.String oid) throws java.io.IOException
oid
- The stringified object identifier.
java.io.IOException
public static java.lang.String decodeObjectIdentifier(byte[] arr) throws java.io.IOException
arr
- The byte array containing the oid in ASN1 format.
java.io.IOException
public static byte[] gssExportName(java.lang.String oid, java.lang.String name)
Offset | Meaning | Value |
0 | token id | 0x04 |
1 | token id | 0x01 |
2 | oid length | hi-byte (len/0xFF) |
3 | oid length | lo-byte (len%0xFF) |
4 | oid | oid:1.3.6.1.5.6.4 |
n+0 | name length | len/0xFFFFFF |
n+1 | name length | (len%0xFFFFFF)/0xFFFF |
n+2 | name length | ((len%0xFFFFFF)%0xFFFF)/0xFF |
n+3 | name length | ((len%0xFFFFFF)%0xFFFF)%0xFF |
n+4 | name | foo |
oid
- The oid of the mechanism this name is exported from.name
- The name to be exported.
public static java.lang.String gssImportName(byte[] name_tok)
name_tok
- The GSS name token.
public static byte[] encodeGSSUPToken(org.omg.CORBA.ORB orb, org.omg.IOP.Codec codec, java.lang.String user, char[] pwd, java.lang.String target)
Offset | Meaning |
0 | ASN1 tag |
1 | token length (<128) |
2 | mechanism oid |
n | mechanism specific token (e.g. GSSUP::InitialContextToken) |
orb
- The orb to get an Any from.codec
- The codec to do the encoding of the Any.user
- The username.pwd
- The password of the user.target
- The target name.
public static boolean decodeGSSUPToken(org.omg.IOP.Codec codec, byte[] token_arr, InitialContextToken gssup_tok)
codec
- The codec to do the encoding of the Any.gssup_tok
- The InitialContextToken struct to fill in the decoded values.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |