iaik.security.ssl
Class SignatureAndHashAlgorithm

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

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

Implements the TLS 1.2 SignatureAndHashAlgorithm structure as specified by RFC 5246.

A TLS 1.2 client/server may use the SignatureAndHashAlgorithm structure to announce the signature/hash algorithms it is able to support to the peer. The client, for instance, may send a SignatureAlgorithms extension with the ClientHello extension list to tell the server which SignatureAndHashAlgorithms the client can process to, e.g., verify the server certificates or, e.g., sign the CertificateVerify message.
The server, for instance, will specify a list of expected SignatureAndHashAlgorithms when sending the CertificateRequest message.

Each SignatureAndHashAlgorithm elements is composed of an pair of hash and corresponding signature algorithm:

    enum {
        none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5),
        sha512(6), (255)
    } HashAlgorithm;

     enum { anonymous(0), rsa(1), dsa(2), ecdsa(3), (255) }
       SignatureAlgorithm;

     struct {
          HashAlgorithm hash;
          SignatureAlgorithm signature;
    } SignatureAndHashAlgorithm;

    SignatureAndHashAlgorithm
      supported_signature_algorithms<2..2^16-2>;
 
The following SignatureAndHash algorithms are supported by iSaSiLk:

See Also:
SignatureAlgorithms, SignatureAndHashAlgorithmList

Field Summary
static SignatureAndHashAlgorithm MD5withRSA
          SignatureAndHashAlgorithm "MD5withRSA" (id: 0x0101).
static SignatureAndHashAlgorithm SHA1withDSA
          SignatureAndHashAlgorithm "SHA1withDSA" (id: 0x0202).
static SignatureAndHashAlgorithm SHA1withECDSA
          SignatureAndHashAlgorithm "SHA1withECDSA" (id: 0x0203).
static SignatureAndHashAlgorithm SHA1withRSA
          SignatureAndHashAlgorithm "SHA1withRSA" (id: 0x0201).
static SignatureAndHashAlgorithm SHA224withDSA
          SignatureAndHashAlgorithm "SHA224withDSA" (id: 0x0302).
static SignatureAndHashAlgorithm SHA224withECDSA
          SignatureAndHashAlgorithm "SHA224withECDSA" (id: 0x0303).
static SignatureAndHashAlgorithm SHA224withRSA
          SignatureAndHashAlgorithm "SHA224withRSA" (id: 0x0301).
static SignatureAndHashAlgorithm SHA256withDSA
          SignatureAndHashAlgorithm "SHA256withDSA" (id: 0x0402).
static SignatureAndHashAlgorithm SHA256withECDSA
          SignatureAndHashAlgorithm "SHA256withECDSA" (id: 0x0403).
static SignatureAndHashAlgorithm SHA256withRSA
          SignatureAndHashAlgorithm "SHA256withRSA" (id: 0x0401).
static SignatureAndHashAlgorithm SHA384withDSA
          SignatureAndHashAlgorithm "SHA384withDSA" (id: 0x0502).
static SignatureAndHashAlgorithm SHA384withECDSA
          SignatureAndHashAlgorithm "SHA384withECDSA" (id: 0x0503).
static SignatureAndHashAlgorithm SHA384withRSA
          SignatureAndHashAlgorithm "SHA384withRSA" (id: 0x0501).
static SignatureAndHashAlgorithm SHA512withDSA
          SignatureAndHashAlgorithm "SHA512withDSA" (id: 0x0602).
static SignatureAndHashAlgorithm SHA512withECDSA
          SignatureAndHashAlgorithm "SHA512withECDSA" (id: 0x0603).
static SignatureAndHashAlgorithm SHA512withRSA
          SignatureAndHashAlgorithm "SHA512withRSA" (id: 0x0601).
 
Constructor Summary
SignatureAndHashAlgorithm(int hashAlgId, int sigAlgId, java.lang.String name)
          Creates a new SignatureAndHashAlgorithm from hash alg, sig alg id, and name.
SignatureAndHashAlgorithm(int id, java.lang.String name)
          Creates a new SignatureAndHashAlgorithm from SignatureAndHashAlgorithm id and name.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this SigAndHashAlgId.
 boolean equals(java.lang.Object obj)
          Compares this SigAndHashAlgId to the specified object.
 int getId()
          Gets the id value.
 java.lang.String getName()
          Gets the SignatureAndHashAlgorithm algorithm name.
 int hashCode()
          Gets a hashcode of this SigAndHashAlgId object.
 java.lang.String toString()
          Gets a String representation of this SignatureAndHashAlgorithm object.
 java.lang.String toString(boolean detailed)
          Gets a String representation of this SignatureAndHashAlgorithm object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MD5withRSA

public static final SignatureAndHashAlgorithm MD5withRSA
SignatureAndHashAlgorithm "MD5withRSA" (id: 0x0101).


SHA1withRSA

public static final SignatureAndHashAlgorithm SHA1withRSA
SignatureAndHashAlgorithm "SHA1withRSA" (id: 0x0201).


SHA224withRSA

public static final SignatureAndHashAlgorithm SHA224withRSA
SignatureAndHashAlgorithm "SHA224withRSA" (id: 0x0301).


SHA256withRSA

public static final SignatureAndHashAlgorithm SHA256withRSA
SignatureAndHashAlgorithm "SHA256withRSA" (id: 0x0401).


SHA384withRSA

public static final SignatureAndHashAlgorithm SHA384withRSA
SignatureAndHashAlgorithm "SHA384withRSA" (id: 0x0501).


SHA512withRSA

public static final SignatureAndHashAlgorithm SHA512withRSA
SignatureAndHashAlgorithm "SHA512withRSA" (id: 0x0601).


SHA1withDSA

public static final SignatureAndHashAlgorithm SHA1withDSA
SignatureAndHashAlgorithm "SHA1withDSA" (id: 0x0202).


SHA224withDSA

public static final SignatureAndHashAlgorithm SHA224withDSA
SignatureAndHashAlgorithm "SHA224withDSA" (id: 0x0302).


SHA256withDSA

public static final SignatureAndHashAlgorithm SHA256withDSA
SignatureAndHashAlgorithm "SHA256withDSA" (id: 0x0402).


SHA384withDSA

public static final SignatureAndHashAlgorithm SHA384withDSA
SignatureAndHashAlgorithm "SHA384withDSA" (id: 0x0502).


SHA512withDSA

public static final SignatureAndHashAlgorithm SHA512withDSA
SignatureAndHashAlgorithm "SHA512withDSA" (id: 0x0602).


SHA1withECDSA

public static final SignatureAndHashAlgorithm SHA1withECDSA
SignatureAndHashAlgorithm "SHA1withECDSA" (id: 0x0203).


SHA224withECDSA

public static final SignatureAndHashAlgorithm SHA224withECDSA
SignatureAndHashAlgorithm "SHA224withECDSA" (id: 0x0303).


SHA256withECDSA

public static final SignatureAndHashAlgorithm SHA256withECDSA
SignatureAndHashAlgorithm "SHA256withECDSA" (id: 0x0403).


SHA384withECDSA

public static final SignatureAndHashAlgorithm SHA384withECDSA
SignatureAndHashAlgorithm "SHA384withECDSA" (id: 0x0503).


SHA512withECDSA

public static final SignatureAndHashAlgorithm SHA512withECDSA
SignatureAndHashAlgorithm "SHA512withECDSA" (id: 0x0603).

Constructor Detail

SignatureAndHashAlgorithm

public SignatureAndHashAlgorithm(int hashAlgId,
                                 int sigAlgId,
                                 java.lang.String name)
Creates a new SignatureAndHashAlgorithm from hash alg, sig alg id, and name.

Parameters:
hashAlgId - the hash algorithm id value as int
sigAlgId - the signature algorithm id value as int
name - the SignatureAndHashAlgorithm name
Throws:
java.lang.IllegalArgumentException - if the id type value is out of range (not between [0x00 0x00] and [0xFF 0xFF])

SignatureAndHashAlgorithm

public SignatureAndHashAlgorithm(int id,
                                 java.lang.String name)
Creates a new SignatureAndHashAlgorithm from SignatureAndHashAlgorithm id and name.

Parameters:
id - the SignatureAndHashAlgorithm algorithm id value as int (comprising hash alg id and sig alg id; two uint8 values)
name - the SignatureAndHashAlgorithm name
Throws:
java.lang.IllegalArgumentException - if the id type value is out of range (not between [0x00 0x00] and [0xFF 0xFF])
Method Detail

getId

public int getId()
Gets the id value.

Returns:
the id value as int (comprising hash alg id and sig alg id; two uint8 values).

getName

public java.lang.String getName()
Gets the SignatureAndHashAlgorithm algorithm name.

Returns:
the signature algorithm name or "Unkown" if no name has been assigned to this SigAndHashAlgId

equals

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

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

hashCode

public int hashCode()
Gets a hashcode of this SigAndHashAlgId 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 SigAndHashAlgId.

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

toString

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

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

toString

public java.lang.String toString(boolean detailed)
Gets a String representation of this SignatureAndHashAlgorithm object.

Parameters:
detailed - whether to include the hash/signature id values
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 5.104, (c) 2002 IAIK, (c) 2003 - 2015 SIC