APIdia Launch Partner
Top Description Fields Constructors Methods
org.ietf.jgss

public Class ChannelBinding

extends Object
Class Inheritance
Known Direct Subclasses
sun.security.jgss.krb5.internal.TlsChannelBindingImpl
Imports
java.net.InetAddress, java.util.Arrays

This class encapsulates the concept of caller-provided channel binding information. Channel bindings are used to strengthen the quality with which peer entity authentication is provided during context establishment. They enable the GSS-API callers to bind the establishment of the security context to relevant characteristics like addresses or to application specific data.

The caller initiating the security context must determine the appropriate channel binding values to set in the GSSContext object. The acceptor must provide an identical binding in order to validate that received tokens possess correct channel-related characteristics.

Use of channel bindings is optional in GSS-API. ChannelBinding can be set for the GSSContext using the setChannelBinding method before the first call to initSecContext or acceptSecContext has been performed. Unless the setChannelBinding method has been used to set the ChannelBinding for a GSSContext object, null ChannelBinding will be assumed.

Conceptually, the GSS-API concatenates the initiator and acceptor address information, and the application supplied byte array to form an octet string. The mechanism calculates a MIC over this octet string and binds the MIC to the context establishment token emitted by initSecContext method of the GSSContext interface. The same bindings are set by the context acceptor for its GSSContext object and during processing of the acceptSecContext method a MIC is calculated in the same way. The calculated MIC is compared with that found in the token, and if the MICs differ, accept will throw a GSSException with the major code set to BAD_BINDINGS, and the context will not be established. Some mechanisms may include the actual channel binding data in the token (rather than just a MIC); applications should therefore not use confidential data as channel-binding components.

Individual mechanisms may impose additional constraints on addresses that may appear in channel bindings. For example, a mechanism may verify that the initiator address field of the channel binding contains the correct network address of the host system. Portable applications should therefore ensure that they either provide correct information for the address fields, or omit setting of the addressing information.

Author
Mayank Upadhyay
Since
1.4

Field Summary

Modifier and TypeField and Description
private final InetAddress
private byte[]
private final InetAddress

Constructor Summary

AccessConstructor and Description
public
ChannelBinding(InetAddress
the address of the context initiator. null value can be supplied to indicate that the application does not want to set this value.
initAddr
,
InetAddress
the address of the context acceptor. null value can be supplied to indicate that the application does not want to set this value.
acceptAddr
,
byte[]
application supplied data to be used as part of the channel bindings. null value can be supplied to indicate that the application does not want to set this value.
appData
)

Create a ChannelBinding object with user supplied address information and data.

public
ChannelBinding(byte[]
application supplied data to be used as part of the channel bindings.
appData
)

Creates a ChannelBinding object without any addressing information.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the two ChannelBinding's contain the same values for the initiator and acceptor addresses and the application data.
equals
(Object
another ChannelBinding to compare this one with
obj
)

Overrides java.lang.Object.equals.

Compares two instances of ChannelBinding.

public InetAddress

Returns:

the acceptor's address. null is returned if the address has not been set.
getAcceptorAddress
()

Get the acceptor's address for this channel binding.

public byte[]

Returns:

the application data being used as part of the ChannelBinding. null is returned if no application data has been specified for the channel binding.
getApplicationData
()

Get the application specified data for this channel binding.

public InetAddress

Returns:

the initiator's address. null is returned if the address has not been set.
getInitiatorAddress
()

Get the initiator's address for this channel binding.

public int

Returns:

a hashcode value for this ChannelBinding object
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hashcode value for this ChannelBinding object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

acceptorback to summary
private final InetAddress acceptor
appDataback to summary
private byte[] appData
initiatorback to summary
private final InetAddress initiator

Constructor Detail

ChannelBindingback to summary
public ChannelBinding(InetAddress initAddr, InetAddress acceptAddr, byte[] appData)

Create a ChannelBinding object with user supplied address information and data. null values can be used for any fields which the application does not want to specify.

Parameters
initAddr:InetAddress

the address of the context initiator. null value can be supplied to indicate that the application does not want to set this value.

acceptAddr:InetAddress

the address of the context acceptor. null value can be supplied to indicate that the application does not want to set this value.

appData:byte[]

application supplied data to be used as part of the channel bindings. null value can be supplied to indicate that the application does not want to set this value.

ChannelBindingback to summary
public ChannelBinding(byte[] appData)

Creates a ChannelBinding object without any addressing information.

Parameters
appData:byte[]

application supplied data to be used as part of the channel bindings.

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Compares two instances of ChannelBinding.

Parameters
obj:Object

another ChannelBinding to compare this one with

Returns:boolean

true if the two ChannelBinding's contain the same values for the initiator and acceptor addresses and the application data.

Annotations
@Override
getAcceptorAddressback to summary
public InetAddress getAcceptorAddress()

Get the acceptor's address for this channel binding.

Returns:InetAddress

the acceptor's address. null is returned if the address has not been set.

getApplicationDataback to summary
public byte[] getApplicationData()

Get the application specified data for this channel binding.

Returns:byte[]

the application data being used as part of the ChannelBinding. null is returned if no application data has been specified for the channel binding.

getInitiatorAddressback to summary
public InetAddress getInitiatorAddress()

Get the initiator's address for this channel binding.

Returns:InetAddress

the initiator's address. null is returned if the address has not been set.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hashcode value for this ChannelBinding object.

Returns:int

a hashcode value for this ChannelBinding object

Annotations
@Override