|Applies To||RSA ClearTrust 5.0.1 Administrative Java API|
|Issue||How to make an IUniqueIdentifier object available for a Web page|
|Cause||A common use of the Java Admin API is to build a custom user interface for administration. A typical GUI application characteristic is to provide a selection list (e.g. a list of peoples' UserID values): |
- Print a list of candidate items (keys)
This processing sequence can be implemented relatively easily with Java primitive types (e.g. integer, string, dword, etc). RSA ClearTrust objects are referenced as IUniqueIdentifier type objects, a non-primitive type. See JavaDoc pages for more specific information regarding IUniqueIdentifier.
|Resolution||The IUniqueIdentifier object is serializable, i.e. it will allow itself to be stored and then retrieved for a later purpose.|
An IUniqueIdentifier object can be converted to a printable form by serializing the object into a stream of base64-encoded characters. For example:
// Query user "jdoe"
/* Implement a Java class "Base64OutputStream" that extends java.io.ByteArrayOutputStream to convert the streamed object to a base64 encoding. */
Base64OutputStream stream = new Base64OutputStream();
ObjectOutputStream output = new ObjectOutputStream(stream);
The output streaming object could not be interrogated to obtain the Base64 representation that could be transmitted on an HTML page, for example:
String bstring = stream.encoded();
Upon deserialization, Base64 decode the streamed object to recover the target IUniqueIdentifier object.
NOTE: This would require implementing a Java class "Base64InputStream" that extends java.io.ByteArrayInputStream
|Legacy Article ID||a18853|