public abstract class Extension
extends java.lang.Object
implements java.lang.Cloneable
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
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
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.
ServerNameList
,
UnknownExtension
Modifier and Type | Method and Description |
---|---|
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.
|
public ExtensionType getExtensionType()
public int getType()
public java.lang.String getName()
public void setCritical(boolean critical)
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.
critical
decides whether to abort
(critical = true
) the handshake if the client did not sent
an expected extension.
true
(client-side), false
(server-side)critical
- true
if the extension is critical,
false
if notpublic java.lang.Object clone()
clone
in class java.lang.Object
public abstract java.lang.String toString()
toString
in class java.lang.Object
public int[] getAllowedProtocolVersions()