public class

GSSHeader

extends Object
java.lang.Object
   ↳ sun.security.jgss.GSSHeader

Class Overview

This class represents the mechanism independent part of a GSS-API context establishment token. Some mechanisms may choose to encode all subsequent tokens as well such that they start with an encoding of an instance of this class. e.g., The Kerberos v5 GSS-API Mechanism uses this header for all GSS-API tokens.

The format is specified in RFC 2743 section 3.1.

Summary

Constants
int TOKEN_ID The tag defined in the GSS-API mechanism independent token format.
Public Constructors
GSSHeader(ObjectIdentifier mechOid, int mechTokenLength)
Creates a GSSHeader instance whose encoding can be used as the prefix for a particular mechanism token.
GSSHeader(InputStream is)
Reads in a GSSHeader from an InputStream.
Public Methods
int encode(OutputStream os)
Encodes this GSSHeader instance onto the provided OutputStream.
int getLength()
Used to obtain the length of the encoding of this GSSHeader.
static int getMaxMechTokenSize(ObjectIdentifier mechOid, int maxTotalSize)
Used to determine what the maximum possible mechanism token size is if the complete GSSToken returned to the application (including a GSSHeader) is not to exceed some pre-determined value in size.
int getMechTokenLength()
Used to obtain the length of the mechanism specific token that will follow the encoding of this GSSHeader instance.
ObjectIdentifier getOid()
Used to obtain the Oid stored in this GSSHeader instance.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int TOKEN_ID

The tag defined in the GSS-API mechanism independent token format.

Constant Value: 96 (0x00000060)

Public Constructors

public GSSHeader (ObjectIdentifier mechOid, int mechTokenLength)

Creates a GSSHeader instance whose encoding can be used as the prefix for a particular mechanism token.

Parameters
mechOid the Oid of the mechanism which generated the token
mechTokenLength the length of the subsequent portion that the mechanism will be adding.
Throws
IOException

public GSSHeader (InputStream is)

Reads in a GSSHeader from an InputStream. Typically this would be used as part of reading the complete token from an InputStream that is obtained from a socket.

Public Methods

public int encode (OutputStream os)

Encodes this GSSHeader instance onto the provided OutputStream.

Parameters
os the OutputStream to which the token should be written.
Returns
  • the number of bytes that are output as a result of this encoding
Throws
IOException

public int getLength ()

Used to obtain the length of the encoding of this GSSHeader.

Returns
  • the lenght of the encoding of this GSSHeader instance.

public static int getMaxMechTokenSize (ObjectIdentifier mechOid, int maxTotalSize)

Used to determine what the maximum possible mechanism token size is if the complete GSSToken returned to the application (including a GSSHeader) is not to exceed some pre-determined value in size.

Parameters
mechOid the Oid of the mechanism that will generate this GSS-API token
maxTotalSize the pre-determined value that serves as a maximum size for the complete GSS-API token (including a GSSHeader)
Returns
  • the maximum size of mechanism token that can be used so as to not exceed maxTotalSize with the GSS-API token

public int getMechTokenLength ()

Used to obtain the length of the mechanism specific token that will follow the encoding of this GSSHeader instance.

Returns
  • the length of the mechanism specific token portion that will follow this GSSHeader.

public ObjectIdentifier getOid ()

Used to obtain the Oid stored in this GSSHeader instance.

Returns
  • the Oid of the mechanism.