0..1 TOK_ID Identification field.
01 01 - Mic token
02 01 - Wrap token
2..3 SGN_ALG Checksum algorithm indicator.
00 00 - DES MAC MD5
01 00 - MD2.5
02 00 - DES MAC
04 00 - HMAC SHA1 DES3-KD
11 00 - RC4-HMAC
4..5 SEAL_ALG ff ff - none
00 00 - DES
02 00 - DES3-KD
10 00 - RC4-HMAC
6..7 Filler Contains ff ff
8..15 SND_SEQ Encrypted sequence number field.
16..s+15 SGN_CKSUM Checksum of plaintext padded data,
calculated according to algorithm
specified in SGN_ALG field.
s+16..last Data encrypted or plaintext padded data
Where "s" indicates the size of the checksum.
As always, this is preceded by a GSSHeader.
sun.security.jgss.GSSHeader
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | MessageToken.
This inner class represents the initial portion of the message token and contains information about the checksum and encryption algorithms that are in use. |
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| pack-priv CipherHelper | |
| private boolean | |
| private byte[] | |
| private static final int | FILLER
Filler data as defined in the specification of the Kerberos v5 GSS-API Mechanism. |
| private GSSHeader | |
| private boolean | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | SEAL_ALG_DES3_KD
Use DES3-KD sealing algorithm. |
| pack-priv static final int | SEAL_ALG_NONE
A value for the SEAL_ALG field that indicates that no encryption was used. |
| private static final int | |
| private int | |
| private byte[] | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private MessageToken. | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv | MessageToken(int
the token id that should be contained in this token as
it is read. tokenId, Krb5Context the Kerberos context associated with this token context, byte[] the byte array containing the token tokenBytes, int the offset where the token begins tokenOffset, int the length of the token tokenLen, MessageProp the MessageProp structure in which the properties of the
token should be stored. prop)Constructs a MessageToken from a byte array. |
| pack-priv | MessageToken(int
the token id that should be contained in this token as
it is read. tokenId, Krb5Context the Kerberos context associated with this token context, InputStream the InputStream from which to read is, MessageProp the MessageProp structure in which the properties of the
token should be stored. prop)Constructs a MessageToken from an InputStream. |
| pack-priv | MessageToken(int
the token id that should be contained in this token tokenId, Krb5Context the Kerberos context associated with this token context)Constructs an empty MessageToken for the local context to send to the peer. |
| Modifier and Type | Method and Description |
|---|---|
| public void | encode(OutputStream
the OutputStream to which this should be written os)Encodes a GSSHeader and this token onto an OutputStream. |
| public void | genSignAndSeqNumber(MessageProp
the MessageProp structure that determines what sort of
checksum and sealing algorithm should be used. The lower byte
of qop determines the checksum algorithm while the upper byte
determines the signing algorithm.
Checksum values are:
0 - default (DES_MAC)
1 - MD5
2 - DES_MD5
3 - DES_MAC
4 - HMAC_SHA1
Sealing values are:
0 - default (DES)
1 - DES
2 - DES3-KD prop, byte[] an optional header that will be processed first
during checksum calculation optionalHeader, byte[] the application data to checksum data, int the offset where the data starts offset, int the length of the data len, byte[] an optional trailer that will be processed
last during checksum calculation. e.g., padding that should be
appended to the application data optionalTrailer)Generates the checksum field and the encrypted sequence number field. |
| public final byte[] | Returns: the checksum in the tokenUsed to obtain the checksum that was contained in this token. |
| private byte[] | getChecksum(byte[]
an optional header that will be processed first
during checksum calculation. optionalHeader, byte[] the application data data, int the offset where the data begins offset, int the length of the application data len, byte[] an optional trailer that will be processed last
during checksum calculation. e.g., padding that should be appended to
the application data optionalTrailer)Computes the checksum based on the algorithm stored in the tokenHeader. |
| public final boolean | Returns: true if it contains any encrypted data, false if there is only plaintext data or if there is no data.Used to determine if this token contains any encrypted data. |
| public final byte[] | Returns: the encrypted sequence number in the tokenUsed to obtain the encrypted sequence number in this token. |
| public final GSSHeader | |
| protected int | |
| protected abstract int | getSealAlg(boolean
true if the application desired confidentiality
on this token, false otherwise confRequested, int the qop requested by the application qop)Obtains the encryption algorithm that should be used in this token given the state of confidentiality the application requested. |
| public final int | |
| protected int | |
| public final int | Returns: the token id in the tokenUsed to obtain the token id that was contained in this token. |
| protected final int | |
| protected static final int | |
| private void | |
| public final boolean | verifySignAndSeqNumber(byte[]
an optional header that will be processed first
during checksum calculation. optionalHeader, byte[] the application data data, int the offset where the data begins offset, int the length of the application data len, byte[] an optional trailer that will be processed last
during checksum calculation. e.g., padding that should be appended to
the application data optionalTrailer)Verifies that the checksum field and sequence number direction bytes are valid and consistent with the application data. |
| checksum | back to summary |
|---|---|
| private byte[] checksum | |
| cipherHelper | back to summary |
|---|---|
| pack-priv CipherHelper cipherHelper | |
| confState | back to summary |
|---|---|
| private boolean confState | |
| encSeqNumber | back to summary |
|---|---|
| private byte[] encSeqNumber | |
| FILLER | back to summary |
|---|---|
| private static final int FILLER Filler data as defined in the specification of the Kerberos v5 GSS-API Mechanism. | |
| gssHeader | back to summary |
|---|---|
| private GSSHeader gssHeader | |
| initiator | back to summary |
|---|---|
| private boolean initiator | |
| SEAL_ALG_ARCFOUR_HMAC | back to summary |
|---|---|
| pack-priv static final int SEAL_ALG_ARCFOUR_HMAC | |
| SEAL_ALG_DES | back to summary |
|---|---|
| pack-priv static final int SEAL_ALG_DES | |
| SEAL_ALG_DES3_KD | back to summary |
|---|---|
| pack-priv static final int SEAL_ALG_DES3_KD Use DES3-KD sealing algorithm. (draft-raeburn-cat-gssapi-krb5-3des-00) This algorithm uses triple-DES with key derivation, with a usage value KG_USAGE_SEAL. Padding is still to 8-byte multiples, and the IV for encrypting application data is zero. | |
| SEAL_ALG_NONE | back to summary |
|---|---|
| pack-priv static final int SEAL_ALG_NONE A value for the SEAL_ALG field that indicates that no encryption was used. | |
| SEAL_ALG_POS | back to summary |
|---|---|
| private static final int SEAL_ALG_POS | |
| seqNumber | back to summary |
|---|---|
| private int seqNumber | |
| seqNumberData | back to summary |
|---|---|
| private byte[] seqNumberData | |
| SGN_ALG_DES_MAC | back to summary |
|---|---|
| pack-priv static final int SGN_ALG_DES_MAC | |
| SGN_ALG_DES_MAC_MD5 | back to summary |
|---|---|
| pack-priv static final int SGN_ALG_DES_MAC_MD5 | |
| SGN_ALG_HMAC_MD5_ARCFOUR | back to summary |
|---|---|
| pack-priv static final int SGN_ALG_HMAC_MD5_ARCFOUR | |
| SGN_ALG_HMAC_SHA1_DES3_KD | back to summary |
|---|---|
| pack-priv static final int SGN_ALG_HMAC_SHA1_DES3_KD | |
| SIGN_ALG_POS | back to summary |
|---|---|
| private static final int SIGN_ALG_POS | |
| TOKEN_ID_POS | back to summary |
|---|---|
| private static final int TOKEN_ID_POS | |
| TOKEN_NO_CKSUM_SIZE | back to summary |
|---|---|
| private static final int TOKEN_NO_CKSUM_SIZE | |
| tokenHeader | back to summary |
|---|---|
| private MessageToken. | |
| tokenId | back to summary |
|---|---|
| private int tokenId | |
| MessageToken | back to summary |
|---|---|
| pack-priv MessageToken(int tokenId, Krb5Context context, byte[] tokenBytes, int tokenOffset, int tokenLen, MessageProp prop) throws GSSException Constructs a MessageToken from a byte array. If there are more bytes in the array than needed, the extra bytes are simply ignored.
| |
| MessageToken | back to summary |
|---|---|
| pack-priv MessageToken(int tokenId, Krb5Context context, InputStream is, MessageProp prop) throws GSSException Constructs a MessageToken from an InputStream. Bytes will be read on demand and the thread might block if there are not enough bytes to complete the token.
| |
| MessageToken | back to summary |
|---|---|
| pack-priv MessageToken(int tokenId, Krb5Context context) throws GSSException Constructs an empty MessageToken for the local context to send to the peer. It also increments the local sequence number in the Krb5Context instance it uses after obtaining the object lock for it.
| |
| encode | back to summary |
|---|---|
| public void encode(OutputStream os) throws IOException, GSSException Encodes a GSSHeader and this token onto an OutputStream.
| |
| genSignAndSeqNumber | back to summary |
|---|---|
| public void genSignAndSeqNumber(MessageProp prop, byte[] optionalHeader, byte[] data, int offset, int len, byte[] optionalTrailer) throws GSSException Generates the checksum field and the encrypted sequence number field. The encrypted sequence number uses the 8 bytes of the checksum as an initial vector in a fixed DesCbc algorithm.
| |
| getChecksum | back to summary |
|---|---|
| public final byte[] getChecksum() Used to obtain the checksum that was contained in this token.
| |
| getChecksum | back to summary |
|---|---|
| private byte[] getChecksum(byte[] optionalHeader, byte[] data, int offset, int len, byte[] optionalTrailer) throws GSSException Computes the checksum based on the algorithm stored in the tokenHeader.
| |
| getConfState | back to summary |
|---|---|
| public final boolean getConfState() Used to determine if this token contains any encrypted data.
| |
| getEncSeqNumber | back to summary |
|---|---|
| public final byte[] getEncSeqNumber() Used to obtain the encrypted sequence number in this token.
| |
| getGSSHeader | back to summary |
|---|---|
| public final GSSHeader getGSSHeader() Used to obtain the GSSHeader that was at the start of this token. | |
| getKrb5TokenSize | back to summary |
|---|---|
| protected int getKrb5TokenSize() throws GSSException Obtains the size of this token. Note that this excludes the size of the GSSHeader.
| |
| getSealAlg | back to summary |
|---|---|
| protected abstract int getSealAlg(boolean confRequested, int qop) throws GSSException Obtains the encryption algorithm that should be used in this token given the state of confidentiality the application requested. Requested qop must be consistent with negotiated session key.
| |
| getSequenceNumber | back to summary |
|---|---|
| public final int getSequenceNumber() | |
| getSgnAlg | back to summary |
|---|---|
| protected int getSgnAlg(int qop) throws GSSException Determine signing algorithm based on QOP. | |
| getTokenId | back to summary |
|---|---|
| public final int getTokenId() Used to obtain the token id that was contained in this token.
| |
| getTokenSize | back to summary |
|---|---|
| protected final int getTokenSize() throws GSSException | |
| getTokenSize | back to summary |
|---|---|
| protected static final int getTokenSize(CipherHelper ch) throws GSSException | |
| init | back to summary |
|---|---|
| private void init(int tokenId, Krb5Context context) throws GSSException | |
| verifySignAndSeqNumber | back to summary |
|---|---|
| public final boolean verifySignAndSeqNumber(byte[] optionalHeader, byte[] data, int offset, int len, byte[] optionalTrailer) throws GSSException Verifies that the checksum field and sequence number direction bytes are valid and consistent with the application data.
| |
0..1 TOK_ID Identification field.
01 01 - Mic token
02 01 - Wrap token
2..3 SGN_ALG Checksum algorithm indicator.
00 00 - DES MAC MD5
01 00 - MD2.5
02 00 - DES MAC
04 00 - HMAC SHA1 DES3-KD
11 00 - RC4-HMAC
4..5 SEAL_ALG ff ff - none
00 00 - DES
02 00 - DES3-KD
10 00 - RC4-HMAC
6..7 Filler Contains ff ff
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| private final int | |
| private final int | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | MessageTokenHeader(int
the token id for this message token tokenId, boolean true if confidentiality will be requested with this
message token, false otherwise. conf, int the value of the quality of protection that will be
desired. qop)Constructs a MessageTokenHeader for the specified token type with appropriate checksum and encryption algorithms fields. |
| public | MessageTokenHeader(InputStream
the InputStream to read from is, MessageProp the MessageProp to populate prop)Constructs a MessageTokenHeader by reading it from an InputStream and sets the appropriate confidentiality and quality of protection values in a MessageProp structure. |
| Modifier and Type | Method and Description |
|---|---|
| public final void | encode(OutputStream
the OutputStream to write to os)Encodes this MessageTokenHeader onto an OutputStream |
| public final byte[] | |
| public final int | |
| public final int | |
| public final int |
| bytes | back to summary |
|---|---|
| private final byte[] bytes | |
| sealAlg | back to summary |
|---|---|
| private final int sealAlg | |
| signAlg | back to summary |
|---|---|
| private final int signAlg | |
| tokenId | back to summary |
|---|---|
| private final int tokenId | |
| MessageTokenHeader | back to summary |
|---|---|
| public MessageTokenHeader(int tokenId, boolean conf, int qop) throws GSSException Constructs a MessageTokenHeader for the specified token type with appropriate checksum and encryption algorithms fields.
| |
| MessageTokenHeader | back to summary |
|---|---|
| public MessageTokenHeader(InputStream is, MessageProp prop) throws IOException Constructs a MessageTokenHeader by reading it from an InputStream and sets the appropriate confidentiality and quality of protection values in a MessageProp structure.
| |
| encode | back to summary |
|---|---|
| public final void encode(OutputStream os) throws IOException Encodes this MessageTokenHeader onto an OutputStream
| |
| getBytes | back to summary |
|---|---|
| public final byte[] getBytes() Returns the bytes of this header.
| |
| getSealAlg | back to summary |
|---|---|
| public final int getSealAlg() Returns the seal algorithm for the message token.
| |
| getSignAlg | back to summary |
|---|---|
| public final int getSignAlg() Returns the sign algorithm for the message token.
| |
| getTokenId | back to summary |
|---|---|
| public final int getTokenId() Returns the token id for the message token.
| |