iaik.security.ssl
Class Extension

java.lang.Object
  extended by iaik.security.ssl.Extension
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
ALPNProtocolNameList, CertificateAuthorities, CertificateStatusRequest, ClientCertificateURL, ExtendedMasterSecret, KeyShare, MaxFragmentLength, PostHandshakeAuth, PskKeyExchangeModes, ServerNameList, SessionTicket, SignatureAlgorithms, SupportedEllipticCurves, SupportedPointFormats, TruncatedHMAC, TrustedAuthorities, UnknownExtension

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

This class is the basic implementation for all TLS extensions. Every class, which implements an extension must be derived from this class.

The general extension structure is defined as (see RFC 4366, or TLS 1.2):

 struct {
    ExtensionType extension_type;
    opaque extension_data<0..2^16-1>;
 } Extension;
 

The extension is identified by its type. The value of the extension is represented as opaque extension data.

The critical flag allows to specify whether to continue or abort the handshake if an expected exception has not be sent by the peer. On the client side critical decides whether to abort (critical = true) the handshake if the client has sent some particular extension in his ClientHello, but the server does not include an extension of the same type in his ServerHello.
On the server side critical decides whether to abort (critical = true) the handshake if the client did not sent an expected extension.
Default: true (client-side), false (server-side)

Depending on the particular Extension in use, the critical flag may have some additional, extension-specific meaning.

Version:
File Revision 36
See Also:
ServerNameList, UnknownExtension

Method Summary
 java.lang.Object clone()
          Gets a clone of this Extension.
 int[] getAllowedProtocolVersions()
          Gets the protocol versions this extension can be used with.
 ExtensionType getExtensionType()
          Gets the type of the extension.
 java.lang.String getName()
          Gets the type name of the extension.
 int getType()
          Gets the type of the extension as int.
 void setCritical(boolean critical)
          Specifies, if the Extension is critical or not.
abstract  java.lang.String toString()
          Gets a String representation of the extension data.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getExtensionType

public ExtensionType getExtensionType()
Gets the type of the extension.

Returns:
the extension type

getType

public int getType()
Gets the type of the extension as int.

Returns:
the type of the extension as int

getName

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

Returns:
the type name of the extension

setCritical

public void setCritical(boolean critical)
Specifies, if the Extension is critical or not.
On the client side critical decides whether to abort (critical = true) the handshake if the client has sent some particular extension in his ClientHello, but the server does not include an extension of this type in his ServerHello.
On the server side critical decides whether to abort (critical = true) the handshake if the client did not sent an expected extension.
Default: true (client-side), false (server-side)

Parameters:
critical - true if the extension is critical, false if not

clone

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

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

toString

public abstract java.lang.String toString()
Gets a String representation of the extension data.

Overrides:
toString in class java.lang.Object
Returns:
the String representation of the extension data

getAllowedProtocolVersions

public int[] getAllowedProtocolVersions()
Gets the protocol versions this extension can be used with. The returned array has two elements, [0] contains the minimumVersion, [1] the maximumVersion.

Returns:
the allowed protocol versions

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