| java.lang.Object org.apache.geronimo.corba.util.Util
Util | final public class Util (Code) | | Various utility functions.
Note: #getORB() and #getCodec() rely on UtilInitializer to initialze the ORB and codec.
version: $Rev: 503493 $ $Date: 2007-02-04 13:47:55 -0800 (Sun, 04 Feb 2007) $ See Also: UtilInitializer |
Method Summary | |
public static String | buildScopedUserName(String user, String domain) | public static String | byteToString(byte[] data) | public static String[] | createCorbaIds(Class type) | public static String | decodeGSSExportName(byte[] name_tok) This function reads a name from a byte array which was created
by the gssExportName() method.
Parameters: name_tok - The GSS name token. | public static boolean | decodeGSSUPToken(Codec codec, byte[] token_arr, InitialContextToken gssup_tok) Decode an GSSUP InitialContextToken from a GSSToken.
Parameters: codec - The codec to do the encoding of the Any. Parameters: gssup_tok - The InitialContextToken struct to fill in the decoded values. | public static String | decodeGeneralName(byte[] name) | public static String | decodeOID(byte[] oid) | public static DERObjectIdentifier | decodeOIDDERObjectIdentifier(byte[] oid) | public static byte[] | encodeGSSExportName(String oid, 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).
The oid to indicate names of this format is:
{1(iso), 3(org), 6(dod), 1(internet), 5(security), 6(nametypes),
4(gss-api-exported-name)}
The token has the following format:
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 |
Parameters: oid - The oid of the mechanism this name is exported from. Parameters: name - The name to be exported. | public static byte[] | encodeGSSUPToken(ORB orb, Codec codec, String user, String pwd, String target) Encode a mechanism independent initial context token (GSSToken). | public static byte[] | encodeGeneralName(String name) | public static byte[] | encodeGeneralName(X509Name x509Name) | public static byte[] | encodeGeneralName(GeneralName generalName) | public static byte[] | encodeOID(String oid) | public static byte[] | encodeOID(DERObjectIdentifier oid) | public static String | extractUserNameFromScopedName(byte[] scopedNameBytes) See csiv2 spec 16.2.5 par. | public static String | extractUserNameFromScopedName(String scopedUserName) | public static Codec | getCodec() | public static Object | getEJBProxy(ProxyInfo info) | public static HandleDelegate | getHandleDelegate() | public static ORB | getORB() | public static ORBConfiguration | getRegisteredORB(String id) | public static Map | mapMethodToOperation(Class intfClass) | public static Map | mapOperationToMethod(Class intfClass) | public static Object | readObject(Class type, InputStream in) | public static void | registerORB(String id, ORBConfiguration orb) | public static void | setORB(ORB orb) | public static void | throwException(Method method, InputStream in) | public static void | unregisterORB(String id) | public static void | writeObject(Class type, Object object, OutputStream out) | public static OutputStream | writeUserException(Method method, ResponseHandler reply, Exception exception) |
byteToString | public static String byteToString(byte[] data)(Code) | | |
decodeGSSExportName | public static String decodeGSSExportName(byte[] name_tok)(Code) | | This function reads a name from a byte array which was created
by the gssExportName() method.
Parameters: name_tok - The GSS name token. The name from the GSS name token. |
decodeGSSUPToken | public static boolean decodeGSSUPToken(Codec codec, byte[] token_arr, InitialContextToken gssup_tok)(Code) | | Decode an GSSUP InitialContextToken from a GSSToken.
Parameters: codec - The codec to do the encoding of the Any. Parameters: gssup_tok - The InitialContextToken struct to fill in the decoded values. Return true when decoding was successful, false otherwise. |
decodeOIDDERObjectIdentifier | public static DERObjectIdentifier decodeOIDDERObjectIdentifier(byte[] oid) throws IOException(Code) | | |
encodeGSSExportName | public static byte[] encodeGSSExportName(String oid, String name)(Code) | | This method encodes a name as if it was encoded using the GSS-API
gss_export_name() function call (see RFC 2743, page 84).
The oid to indicate names of this format is:
{1(iso), 3(org), 6(dod), 1(internet), 5(security), 6(nametypes),
4(gss-api-exported-name)}
The token has the following format:
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 |
Parameters: oid - The oid of the mechanism this name is exported from. Parameters: name - The name to be exported. The byte array representing the exported name object. |
encodeGSSUPToken | public static byte[] encodeGSSUPToken(ORB orb, Codec codec, String user, String pwd, String target)(Code) | | Encode a mechanism independent initial context token (GSSToken). Defined
in [IETF RFC 2743] Section 3.1, "Mechanism-Independent token Format" pp. 81-82.
Offset | Meaning |
0 | ASN1 tag |
1 | token length (<128) |
2 | mechanism oid |
n | mechanism specific token (e.g. GSSUP::InitialContextToken) |
Currently only one mechanism specific token is supported: GSS username password
(GSSUP::InitialContextToken).
Parameters: orb - The orb to get an Any from. Parameters: codec - The codec to do the encoding of the Any. Parameters: user - The username. Parameters: pwd - The password of the user. Parameters: target - The target name. The byte array of the ASN1 encoded GSSToken. |
encodeGeneralName | public static byte[] encodeGeneralName(X509Name x509Name) throws IOException(Code) | | |
encodeGeneralName | public static byte[] encodeGeneralName(GeneralName generalName) throws IOException(Code) | | |
encodeOID | public static byte[] encodeOID(DERObjectIdentifier oid) throws IOException(Code) | | |
extractUserNameFromScopedName | public static String extractUserNameFromScopedName(String scopedUserName)(Code) | | |
getCodec | public static Codec getCodec()(Code) | | |
getEJBProxy | public static Object getEJBProxy(ProxyInfo info)(Code) | | |
getORB | public static ORB getORB()(Code) | | |
mapMethodToOperation | public static Map mapMethodToOperation(Class intfClass)(Code) | | |
mapOperationToMethod | public static Map mapOperationToMethod(Class intfClass)(Code) | | |
setORB | public static void setORB(ORB orb) throws UserException(Code) | | |
unregisterORB | public static void unregisterORB(String id)(Code) | | |
writeObject | public static void writeObject(Class type, Object object, OutputStream out)(Code) | | |
|
|