iaik.security.ssl
Class ExtensionType

java.lang.Object
  extended by iaik.security.ssl.ExtensionType
All Implemented Interfaces:
java.lang.Cloneable

public class ExtensionType
extends java.lang.Object
implements java.lang.Cloneable

This class represents the extension_type field as defined in RFC 4366 TLS Extensions.

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 following extension types are pre-defined by RFC 2546:

 enum {
     server_name(0), max_fragment_length(1),
     client_certificate_url(2), trusted_ca_keys(3),
     truncated_hmac(4), status_request(5), (65535)
 } ExtensionType;
 

See Also:
Extension

Constructor Summary
ExtensionType(int type, java.lang.String name)
          Creates an new ExtensionType.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this ExtensionType.
 boolean equals(java.lang.Object obj)
          Compares this ExtensionType to the specified object.
 java.lang.String getName()
          Gets the extension type name.
 int getType()
          Gets the extension type value.
 int hashCode()
          Gets a hashcode of this ExtensionType object.
 java.lang.String toString()
          Gets a String representation of this ExtensionType object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtensionType

public ExtensionType(int type,
                     java.lang.String name)
Creates an new ExtensionType.

Parameters:
type - the extension type value
name - the extension type name
Throws:
java.lang.IllegalArgumentException - if the extension type value is out of range (not between 0 and 65535)
Method Detail

getType

public int getType()
Gets the extension type value.

Returns:
the extension type value.

getName

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

Returns:
the extension type name or "Unkown" if no name has been assigned to this extension type

equals

public boolean equals(java.lang.Object obj)
Compares this ExtensionType to the specified object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this ExtensionType against.
Returns:
true, if the given object is equal to this ExtensionType, false otherwise

hashCode

public int hashCode()
Gets a hashcode of this ExtensionType object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hashCode of this object

clone

public java.lang.Object clone()
Returns a clone of this ExtensionType.

Overrides:
clone in class java.lang.Object
Returns:
a clone

toString

public java.lang.String toString()
Gets a String representation of this ExtensionType object.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this object.

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