public class InfoUnit extends Object
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_AUTHSCHEME | UTF8 | Specifies which autscheme has been satisfied during logon |
ID_RECIPIENT_CLIENT | UTF8 | Specifies the recipient client of the assertion ticket. |
ID_RECIPIENT_SID | UTF8 | Specifies the recipient system of the assertion ticket. |
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 |
Modifier and Type | Field and Description |
---|---|
static HashMap |
codepageEncoding
Map used to convert an SAP codepage into a ISO or window codepage.
|
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_RECIPIENT_CLIENT
see here for details.
|
static int |
ID_RECIPIENT_SID
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 and Description |
---|
InfoUnit(InputStream in,
int id,
int len)
Utility method.
|
InfoUnit(int id,
byte[] data)
Utility method.
|
Modifier and Type | Method and Description |
---|---|
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 String |
bytesToString(byte[] buffer,
int offset,
int length,
String encoding)
Converts a byte array into a string.
|
static String |
bytesToString(byte[] buffer,
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.
|
String |
getString(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(String source,
String SAPCodepage)
Converts a java String to a byte array.
|
static byte[] |
jcharToUTF8(String source)
Converts a java String to a byte array.
|
static InfoUnit |
readInfoUnit(InputStream in)
Utility method.
|
static byte[] |
readRaw(InputStream in,
int n)
Utility method.
|
void |
writeTo(OutputStream out)
Utility method.
|
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_RECIPIENT_CLIENT
public static final int ID_RECIPIENT_SID
public static HashMap codepageEncoding
String.getBytes(java.lang.String)
public InfoUnit(InputStream in, int id, int len) throws IOException
in
- the InputStreamid
- identifier of the info unitlen
- number of chars to readIOException
- failed or interrupted I/O operationspublic InfoUnit(int id, byte[] data)
id
- identifier of the info unitdata
- content of an info unit as byte arraypublic int getID()
public byte[] getContent()
public String getString(String encoding) throws UnsupportedEncodingException
encoding
- java codepage for encodingUnsupportedEncodingException
- if the encoding is unknownpublic int getInt()
public void writeTo(OutputStream out) throws IOException
out
- the OutputStreamIOException
- failed or interrupted write operationpublic static InfoUnit readInfoUnit(InputStream in) throws IOException
in
- the InputStreamIOException
- failed or interrupted read operationpublic static int bytesToInt(byte[] buffer)
buffer
- byte array of length 4 from an info unitpublic 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 topublic static String bytesToString(byte[] buffer, String encoding) throws UnsupportedEncodingException
buffer
- encoded stringencoding
- used encoding This parameter will be passed to the
InputStreamReader.InputStreamReader(InputStream,String)
constructor.
See also TicketVerifier.getCodepage()
and
encodings.UnsupportedEncodingException
- if the encoding is unknownpublic static String bytesToString(byte[] buffer, int offset, int length, String encoding) throws UnsupportedEncodingException
bytesToString(byte[], String)
but with
a byte array region instead of an entire byte array.buffer
- encoded stringoffset
- the offset in the buffer of the first byte to readlength
- the maximum number of bytes to read from the bufferencoding
- used encoding This parameter will be passed to the
InputStreamReader.InputStreamReader(InputStream,String)
constructor.
See also TicketVerifier.getCodepage()
and
encodings.UnsupportedEncodingException
- if the encoding is unknownpublic static byte[] readRaw(InputStream in, int n) throws IOException
in
- the InputStreamn
- number of chars to readIOException
- failed or interrupted read operationpublic static byte[] jcharToSAPCP(String source, String SAPCodepage) throws UnsupportedEncodingException, IOException
bytesToString(byte[], String)
).source
- the String to be convertedSAPCodepage
- SAP codepage for encodingUnsupportedEncodingException
- if the encoding is unknownIOException
- failed or interrupted I/O operationspublic static byte[] jcharToUTF8(String source) throws UnsupportedEncodingException, IOException
return jcharToSAPCP (source, "4110");
see jcharToSAPCP(String, String)
.source
- the String to be convertedUnsupportedEncodingException
- if the encoding is unknownIOException
- failed or interrupted I/O operationsAccess Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] CORE-TOOLS
|
[sap.com]
|
default
|
BC-JAS
|
[sap.com] ENGFACADE
|
[sap.com] tc/je/usermanagement/api
|
api
|
BC-JAS-SEC
|
[sap.com] ENGINEAPI
|
[sap.com]
|
-
|
BC-JAS-SEC-UME
|
[sap.com] ENGINEAPI
|
[sap.com]
|
default
|
BC-JAS-SEC-UME
|
Copyright 2018 SAP AG Complete Copyright Notice