iaik.security.ssl.chb
Class ChannelBinding

java.lang.Object
  extended by iaik.security.ssl.chb.ChannelBinding
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
TLSServerEndPointChannelBinding, TLSUniqueChannelBinding

public abstract class ChannelBinding
extends java.lang.Object
implements java.lang.Cloneable

This class is the basic implementation for TLS ChannelBindings. Every class, which implements a channel binding is derived from this class.

Currently two channel bindings are implemented according to RFC 5929:

An application that is interested to capture some particular channel binding value(s) has to announce its interest by adding a list of channel bindings to the SSLContext object, e.g.:
 ChannelBindings channelBindings = new ChannelBindings();
 channelBindings.addChannelBinding(new TLSUniqueChannelBinding());
 channelBindings.addChannelBinding(new TLSServerEndPointChannelBinding());
 context.setChannelBindings(channelBindings);
 
After having completed the handshake the channel binding values can be obtained from the SSLSocket:
 ChannelBindings chBndgs = socket.getChannelBindings();
 if (chBndgs != null) {
   TLSUniqueChannelBinding tlsUnique = (TLSUniqueChannelBinding)chBndgs.getChannelBinding(TLSUniqueChannelBinding.TYPE);
   if (tlsUnique != null) {
     System.out.println("tls-unique: " + Util.toString(tlsUnique.getData()));
   }
   TLSServerEndPointChannelBinding tlsServerEndPoint = (TLSServerEndPointChannelBinding)chBndgs.getChannelBinding(TLSServerEndPointChannelBinding.TYPE);
   if (tlsServerEndPoint != null) {
     System.out.println("tls-server-end-point: " + Util.toString(tlsServerEndPoint.getData()));
   }
 }  
 

Version:
File Revision 26
See Also:
ChannelBindings, ChannelBindingType, TLSUniqueChannelBinding, TLSServerEndPointChannelBinding

Constructor Summary
ChannelBinding(ChannelBindingType type)
          Creates a new ChannelBinding for the given type.
ChannelBinding(ChannelBindingType type, byte[] data)
          Creates a new ChannelBinding for given type and data.
 
Method Summary
 java.lang.Object clone()
          Gets a clone of this ChannelBinding.
 boolean equals(java.lang.Object obj)
          Checks if this channel binding is equal to the given object.
 ChannelBindingType getChannelBindingType()
          Gets the type of the channel binding.
 byte[] getData()
          Gets the data of this channel binding.
 java.lang.String getName()
          Gets the type name of the channel binding.
 int getType()
          Gets the type of the channel binding as int.
 int hashCode()
          Gets a hash code of the channel binding.
 java.lang.String toString()
          Gets a String representation of the channel binding.
 java.lang.String toString(boolean detailed)
          Gets a String representation of the channel binding.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChannelBinding

public ChannelBinding(ChannelBindingType type)
Creates a new ChannelBinding for the given type.

Parameters:
type - the type of the ChannelBinding

ChannelBinding

public ChannelBinding(ChannelBindingType type,
                      byte[] data)
Creates a new ChannelBinding for given type and data.

Parameters:
type - the type of the ChannelBinding
data - the channel binding data (will not be cloned!)
Method Detail

getChannelBindingType

public ChannelBindingType getChannelBindingType()
Gets the type of the channel binding.

Returns:
the channel binding type

getType

public int getType()
Gets the type of the channel binding as int.

Returns:
the type of the channel binding as int

getName

public java.lang.String getName()
Gets the type name of the channel binding.

Returns:
the type name of the channel binding

getData

public byte[] getData()
Gets the data of this channel binding.

Returns:
the data (will not be cloned!)

hashCode

public int hashCode()
Gets a hash code of the channel binding.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this channel binding

equals

public boolean equals(java.lang.Object obj)
Checks if this channel binding is equal to the given object.

Overrides:
equals in class java.lang.Object
Returns:
true if this channel binding is equal to the given object, false if it is not equal to it

clone

public java.lang.Object clone()
Gets a clone of this ChannelBinding.

Overrides:
clone in class java.lang.Object
Returns:
a clone of this ChannelBinding

toString

public java.lang.String toString()
Gets a String representation of the channel binding.

Overrides:
toString in class java.lang.Object
Returns:
the String representation of the channel binding

toString

public java.lang.String toString(boolean detailed)
Gets a String representation of the channel binding.

Parameters:
detailed - whether to included the channel binding data in the String output
Returns:
the String representation of the channel binding

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

iSaSiLk 6.0, (c) 2002 IAIK, (c) 2003 - 2015 SIC