Wrap Tokens
Octet no Name Description
---------------------------------------------------------------
0..1 TOK_ID Identification field. Tokens emitted by
GSS_Wrap() contain the hex value 05 04
expressed in big-endian order in this field.
2 Flags Attributes field, as described in section
4.2.2.
3 Filler Contains the hex value FF.
4..5 EC Contains the "extra count" field, in big-
endian order as described in section 4.2.3.
6..7 RRC Contains the "right rotation count" in big
endian order, as described in section 4.2.5.
8..15 SND_SEQ Sequence number field in clear text,
expressed in big-endian order.
16..last Data Encrypted data for Wrap tokens with
confidentiality, or plaintext data followed
by the checksum for Wrap tokens without
confidentiality, as described in section
4.2.4.
MIC Tokens
Octet no Name Description
-----------------------------------------------------------------
0..1 TOK_ID Identification field. Tokens emitted by
GSS_GetMIC() contain the hex value 04 04
expressed in big-endian order in this field.
2 Flags Attributes field, as described in section
4.2.2.
3..7 Filler Contains five octets of hex value FF.
8..15 SND_SEQ Sequence number field in clear text,
expressed in big-endian order.
16..last SGN_CKSUM Checksum of the "to-be-signed" data and
octet 0..15, as described in section 4.2.4.
This class is the super class of WrapToken_v2 and MicToken_v2. The token's header (bytes[0..15]) and data (byte[16..]) are saved in tokenHeader and tokenData fields. Since there is no easy way to find out the exact length of a WrapToken_v2 token from any header info, in the case of reading from stream, we read all available() bytes into the token.
All read actions are performed in this super class. On the write part, the super class only write the tokenHeader, and the content writing is inside child classes.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | MessageToken_v2.
This inner class represents the initial portion of the message token. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv byte[] | |
| pack-priv CipherHelper | |
| protected static final int | CONFOUNDER_SIZE
The size of the random confounder used in a WrapToken. |
| private boolean | |
| private int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private boolean | |
| private boolean | |
| private int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| private int | |
| private int | |
| private static final int | |
| private static final int | |
| protected static final int | |
| private static final int | |
| private static final int | |
| protected byte[] | |
| protected int | |
| private MessageToken_v2. | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv | MessageToken_v2(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_v2(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_v2(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 abstract void | encode(OutputStream
the OutputStream to which this should be written os)Encodes a MessageToken_v2 onto an OutputStream. |
| protected void | encodeHeader(OutputStream
the OutputStream to which this should be written os)Encodes a MessageTokenHeader onto an OutputStream. |
| public void | genSignAndSeqNumber(MessageProp
the MessageProp structure prop, byte[] the application data to checksum data, int the offset where the data starts offset, int the length of the data len)Generates the checksum field and the sequence number field. |
| pack-priv byte[] | getChecksum(byte[]
the application data data, int the offset where the data begins offset, int the length of the application data len)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 int | |
| public final int | |
| protected final byte[] | |
| public final int | Returns: the token id in the tokenUsed to obtain the token id that was contained in this token. |
| private void | |
| private void | |
| public final boolean | verifySign(byte[]
the application data data, int the offset where the data begins offset, int the length of the application data len)Verifies the validity of checksum field |
| checksum | back to summary |
|---|---|
| pack-priv byte[] checksum | |
| cipherHelper | back to summary |
|---|---|
| pack-priv CipherHelper cipherHelper | |
| CONFOUNDER_SIZE | back to summary |
|---|---|
| protected static final int CONFOUNDER_SIZE The size of the random confounder used in a WrapToken. | |
| confState | back to summary |
|---|---|
| private boolean confState | |
| ec | back to summary |
|---|---|
| private int ec | |
| FILLER | back to summary |
|---|---|
| private static final int FILLER | |
| FLAG_ACCEPTOR_SUBKEY | back to summary |
|---|---|
| private static final int FLAG_ACCEPTOR_SUBKEY | |
| FLAG_SENDER_IS_ACCEPTOR | back to summary |
|---|---|
| private static final int FLAG_SENDER_IS_ACCEPTOR | |
| FLAG_WRAP_CONFIDENTIAL | back to summary |
|---|---|
| private static final int FLAG_WRAP_CONFIDENTIAL | |
| have_acceptor_subkey | back to summary |
|---|---|
| private boolean have_acceptor_subkey | |
| initiator | back to summary |
|---|---|
| private boolean initiator | |
| key_usage | back to summary |
|---|---|
| private int key_usage | |
| KG_USAGE_ACCEPTOR_SEAL | back to summary |
|---|---|
| pack-priv static final int KG_USAGE_ACCEPTOR_SEAL | |
| KG_USAGE_ACCEPTOR_SIGN | back to summary |
|---|---|
| pack-priv static final int KG_USAGE_ACCEPTOR_SIGN | |
| KG_USAGE_INITIATOR_SEAL | back to summary |
|---|---|
| pack-priv static final int KG_USAGE_INITIATOR_SEAL | |
| KG_USAGE_INITIATOR_SIGN | back to summary |
|---|---|
| pack-priv static final int KG_USAGE_INITIATOR_SIGN | |
| rrc | back to summary |
|---|---|
| private int rrc | |
| seqNumber | back to summary |
|---|---|
| private int seqNumber | |
| TOKEN_EC_POS | back to summary |
|---|---|
| private static final int TOKEN_EC_POS | |
| TOKEN_FLAG_POS | back to summary |
|---|---|
| private static final int TOKEN_FLAG_POS | |
| TOKEN_HEADER_SIZE | back to summary |
|---|---|
| protected static final int TOKEN_HEADER_SIZE | |
| TOKEN_ID_POS | back to summary |
|---|---|
| private static final int TOKEN_ID_POS | |
| TOKEN_RRC_POS | back to summary |
|---|---|
| private static final int TOKEN_RRC_POS | |
| tokenData | back to summary |
|---|---|
| protected byte[] tokenData | |
| tokenDataLen | back to summary |
|---|---|
| protected int tokenDataLen | |
| tokenHeader | back to summary |
|---|---|
| private MessageToken_v2. | |
| tokenId | back to summary |
|---|---|
| private int tokenId | |
| MessageToken_v2 | back to summary |
|---|---|
| pack-priv MessageToken_v2(int tokenId, Krb5Context context, byte[] tokenBytes, int tokenOffset, int tokenLen, MessageProp prop) throws GSSException Constructs a MessageToken from a byte array.
| |
| MessageToken_v2 | back to summary |
|---|---|
| pack-priv MessageToken_v2(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. Please note there is no accurate way to find out the size of a token, but we try our best to make sure there is enough bytes to construct one.
| |
| MessageToken_v2 | back to summary |
|---|---|
| pack-priv MessageToken_v2(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 abstract void encode(OutputStream os) throws IOException Encodes a MessageToken_v2 onto an OutputStream.
| |
| encodeHeader | back to summary |
|---|---|
| protected void encodeHeader(OutputStream os) throws IOException Encodes a MessageTokenHeader onto an OutputStream.
| |
| genSignAndSeqNumber | back to summary |
|---|---|
| public void genSignAndSeqNumber(MessageProp prop, byte[] data, int offset, int len) throws GSSException Generates the checksum field and the sequence number field.
| |
| getChecksum | back to summary |
|---|---|
| pack-priv byte[] getChecksum(byte[] data, int offset, int len) 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.
| |
| getKeyUsage | back to summary |
|---|---|
| public final int getKeyUsage() Used to obtain the key_usage type for this token.
| |
| getSequenceNumber | back to summary |
|---|---|
| public final int getSequenceNumber() | |
| getTokenHeader | back to summary |
|---|---|
| protected final byte[] getTokenHeader() | |
| getTokenId | back to summary |
|---|---|
| public final int getTokenId() Used to obtain the token id that was contained in this token.
| |
| init | back to summary |
|---|---|
| private void init(int tokenId, Krb5Context context) throws GSSException | |
| rotate | back to summary |
|---|---|
| private void rotate() Rotate bytes as per the "RRC" (Right Rotation Count) received. Our implementation does not do any rotates when sending, only when receiving, we rotate left as per the RRC count, to revert it. | |
| verifySign | back to summary |
|---|---|
| public final boolean verifySign(byte[] data, int offset, int len) throws GSSException Verifies the validity of checksum field
| |
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | MessageTokenHeader(InputStream
the InputStream to read from is, MessageProp the MessageProp to populate prop, int tokId)Reads a MessageTokenHeader 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 |
| bytes | back to summary |
|---|---|
| private final byte[] bytes | |
| tokenId | back to summary |
|---|---|
| private final int tokenId | |
| MessageTokenHeader | back to summary |
|---|---|
| public MessageTokenHeader(int tokenId, boolean conf) throws GSSException | |
| MessageTokenHeader | back to summary |
|---|---|
| public MessageTokenHeader(InputStream is, MessageProp prop, int tokId) throws IOException, GSSException Reads a MessageTokenHeader 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.
| |
| getTokenId | back to summary |
|---|---|
| public final int getTokenId() Returns the token id for the message token.
| |