|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.sap.security.api.ticket.InfoUnit
An InfoUnit is the basic data type for storing information in SAP
logon tickets. You need to use it if you want to retrieve information
from the ticket other than the those available by API calls like
TicketVerifier.getUser(), TicketVerifier.isValid().
Format of InfoUnits on Disk:
| Length | Type | Name |
| 1 | INT1 | ID of InfoUnit (see ID_xxxx) |
| 2 | INT2 | Length n of Content in bytes |
| <INT2 bytes> | see below | Content (Type depends on ID) |
Types of InfoUnits used in SAP Logon Ticket:
| ID | Type | Name |
| ID_USER | CHAR | User name |
| ID_CREATE_CLIENT | CHAR | SystemID of issuing System |
| ID_CREATE_NAME | CHAR | SystemID of issuing System |
| ID_CREATE_TIME | CHAR | Creation time of Ticket as String "yyyymmddhhmm" |
| ID_VALID_TIME | INT4 | Valid time (hours) |
| ID_VALID_TIME_MIN | INT4 | Valid time (minutes) |
| ID_RFC | CHAR | RFC Ticket |
| ID_FLAGS | RAW | Flags |
| ID_SIGNATURE | RAW | PKCS#7 Signature |
| ID_LANGUAGE | CHAR | default language of the user |
| ID_USER_UTF | UTF8 | user name (utf-8 encoded) |
| ID_AUTH_TYPE | CHAR | one letter indicating how the user was authenticated (e.g. NT domain authentication) |
| ID_AUTHSCHEME | UTF8 | Specifies which autscheme has been satisfied during logon |
The values from 0x20 to 0x40 are reserved for additional user id.
Currently, only 0x20 is used (by a portal user id which might differ
from the SAP system user id).
For the above identifiers the data types are as follows. INT4 denotes a 4-byte
integer. RAW denotes a byte array, UTF8 denotes UTF-8 encoding. CHAR means
that the infounit's content is a string value, encoded using an SAP codepage
that you can get from the ticket. In order to get a java.lang.String
object, please use one of the following methods:
| SAP codepage number | corresponding non-SAP codepage |
| 4110 | UTF8 |
| 1100 | ISO8859_1 |
| 1140 | ISO8859_1 |
| 1401 | ISO8859_2 |
| 1500 | ISO8859_5 |
| 1610 | ISO8859_9 |
| 1700 | ISO8859_7 |
| 1800 | ISO8859_8 |
| 1900 | ISO8859_4 |
| 8200 | ISO2022JP |
| 8700 | ISO8859_4 |
| 0120 | Cp500 |
| 1103 | Cp850 |
| 1160 | windows-1252 |
| 1404 | Cp1250 |
| 1504 | Cp1251 |
| 1614 | Cp1254 |
| 1704 | Cp1253 |
| 1804 | Cp1255 |
| 1904 | Cp1257 |
| 8604 | Cp874 |
| 8704 | Cp1256 |
| 8000 | SJIS |
| 8100 | EUC_JP |
| 8300 | Big5 |
| 8600 | TIS620 |
| Field Summary | |
static java.util.HashMap |
codepageEncoding
Map used to convert an SAP codepage into a ISO or window codepage. |
static int |
ID_AUTH_TYPE
see here for details. |
static int |
ID_AUTHSCHEME
see here for details. |
static int |
ID_CREATE_CLIENT
see here for details. |
static int |
ID_CREATE_CLIENT_UTF
see here for details. |
static int |
ID_CREATE_NAME
see here for details. |
static int |
ID_CREATE_NAME_UTF
see here for details. |
static int |
ID_CREATE_TIME
see here for details. |
static int |
ID_CREATE_TIME_UTF
see here for details. |
static int |
ID_FLAGS
see here for details. |
static int |
ID_LANGUAGE
see here for details. |
static int |
ID_LANGUAGE_UTF
see here for details. |
static int |
ID_RFC
see here for details. |
static int |
ID_SIGNATURE
see here for details. |
static int |
ID_USER
see here for details. |
static int |
ID_USER_UTF
see here for details. |
static int |
ID_VALID_TIME
see here for details. |
static int |
ID_VALID_TIME_MIN
see here for details. |
| Constructor Summary | |
InfoUnit(java.io.InputStream in,
int id,
int len)
Utility method. |
|
InfoUnit(int id,
byte[] data)
Utility method. |
|
| Method Summary | |
static int |
bytesToInt(byte[] buffer)
Transform a byte array into an int. |
static int |
bytesToInt(byte[] buffer,
int offset,
int length)
Transform part of a byte array to an integer. |
static java.lang.String |
bytesToString(byte[] buffer,
int offset,
int length,
java.lang.String encoding)
Converts a byte array into a string. |
static java.lang.String |
bytesToString(byte[] buffer,
java.lang.String encoding)
Converts a byte array into a string. |
byte[] |
getContent()
Gets the content of an info unit. |
int |
getID()
Get the ID of this InfoUnit. |
int |
getInt()
Gets the content of an info unit as integer. |
java.lang.String |
getString(java.lang.String encoding)
Get the Content of this InfoUnit as String. |
static byte[] |
IntToBytes(int i)
Transforms an integer into a byte array. |
static byte[] |
jcharToSAPCP(java.lang.String source,
java.lang.String SAPCodepage)
Converts a java String to a byte array. |
static byte[] |
jcharToUTF8(java.lang.String source)
Converts a java String to a byte array. |
static InfoUnit |
readInfoUnit(java.io.InputStream in)
Utility method. |
static byte[] |
readRaw(java.io.InputStream in,
int n)
Utility method. |
void |
writeTo(java.io.OutputStream out)
Utility method. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int ID_USER
public static final int ID_CREATE_CLIENT
public static final int ID_CREATE_NAME
public static final int ID_CREATE_TIME
public static final int ID_VALID_TIME
public static final int ID_RFC
public static final int ID_VALID_TIME_MIN
public static final int ID_FLAGS
public static final int ID_SIGNATURE
public static final int ID_LANGUAGE
public static final int ID_USER_UTF
public static final int ID_CREATE_CLIENT_UTF
public static final int ID_CREATE_NAME_UTF
public static final int ID_CREATE_TIME_UTF
public static final int ID_LANGUAGE_UTF
public static final int ID_AUTHSCHEME
public static final int ID_AUTH_TYPE
public static java.util.HashMap codepageEncoding
String.getBytes(java.lang.String)| Constructor Detail |
public InfoUnit(java.io.InputStream in,
int id,
int len)
throws java.io.IOException
public InfoUnit(int id,
byte[] data)
| Method Detail |
public int getID()
public byte[] getContent()
public java.lang.String getString(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
encoding - java codepage for encodingjava.io.UnsupportedEncodingException - if the encoding is unknownpublic int getInt()
public void writeTo(java.io.OutputStream out)
throws java.io.IOException
public static InfoUnit readInfoUnit(java.io.InputStream in)
throws java.io.IOException
public static int bytesToInt(byte[] buffer)
buffer - byte array of length 4 from an info unit
public static int bytesToInt(byte[] buffer,
int offset,
int length)
bytesToInt(byte[]) but with a byte array region
instead of an entire byte array.buffer - byte arrayoffset - offset into the arraylength - should be equal to 4public static byte[] IntToBytes(int i)
bytesToInt(byte[])i - int to convert to
public static java.lang.String bytesToString(byte[] buffer,
java.lang.String encoding)
throws java.io.UnsupportedEncodingException
buffer - encoded stringencoding - used encoding
This parameter will be passed to the
InputStreamReader#InputStreamReader(InputStream,String) constructor.
See also TicketVerifier.getCodepage() and encodings.java.io.UnsupportedEncodingException - if the encoding is unknown
public static java.lang.String bytesToString(byte[] buffer,
int offset,
int length,
java.lang.String encoding)
throws java.io.UnsupportedEncodingException
bytesToString(byte[], String) but with a
byte array region instead of an entire byte array.java.io.UnsupportedEncodingException - if the encoding is unknown
public static byte[] readRaw(java.io.InputStream in,
int n)
throws java.io.IOException
public static byte[] jcharToSAPCP(java.lang.String source,
java.lang.String SAPCodepage)
throws java.io.UnsupportedEncodingException,
java.io.IOException
bytesToString(byte[], String)).
public static byte[] jcharToUTF8(java.lang.String source)
throws java.io.UnsupportedEncodingException,
java.io.IOException
return jcharToSAPCP (source, "4110");
see jcharToSAPCP(String, String).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||