iaik.security.ssl
Class SignatureAndHashAlgorithm

java.lang.Object
  extended by iaik.security.ssl.SignatureAndHashAlgorithm
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
SignatureScheme

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

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

Note that TLS 1.3 (RFC 8446) replaces the SignatureAndHashAlgorithm type by the SignatureScheme type. For compatibility reasons iSaSiLk can be used with both types, SignatureAndHashAlgorithm and SignatureScheme.

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 ED25519
          SignatureAndHashAlgorithm "ED25519" (id: 0x0807).
static SignatureAndHashAlgorithm ED448
          SignatureAndHashAlgorithm "ED448" (id: 0x0808).
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 SHA256withRSAPSS_PSS
          SignatureAndHashAlgorithm "rsa_pss_pss_sha256" with public key OID RSASSA-PSS (id: 0x0809).
static SignatureAndHashAlgorithm SHA256withRSAPSS_RSAE
          SignatureAndHashAlgorithm "rsa_pss_rsae_sha256" with public key OID rsaEncryption (id: 0x0804).
static SignatureAndHashAlgorithm SHA384withDSA
          SignatureAndHashAlgorithm "SHA384withDSA" (id: 0x0502).
static SignatureAndHashAlgorithm SHA384withECDSA
          SignatureAndHashAlgorithm "SHA384withECDSA" (id: 0x0503).
static SignatureAndHashAlgorithm SHA384withRSA
          SignatureAndHashAlgorithm "SHA384withRSA" (id: 0x0501).
static SignatureAndHashAlgorithm SHA384withRSAPSS_PSS
          SignatureAndHashAlgorithm "rsa_pss_pss_sha384" with public key OID RSASSA-PSS (id: 0x080a).
static SignatureAndHashAlgorithm SHA384withRSAPSS_RSAE
          SignatureAndHashAlgorithm "rsa_pss_rsae_sha384" with public key OID rsaEncryption (id: 0x0805).
static SignatureAndHashAlgorithm SHA512withDSA
          SignatureAndHashAlgorithm "SHA512withDSA" (id: 0x0602).
static SignatureAndHashAlgorithm SHA512withECDSA
          SignatureAndHashAlgorithm "SHA512withECDSA" (id: 0x0603).
static SignatureAndHashAlgorithm SHA512withRSA
          SignatureAndHashAlgorithm "SHA512withRSA" (id: 0x0601).
static SignatureAndHashAlgorithm SHA512withRSAPSS_PSS
          SignatureAndHashAlgorithm "rsa_pss_pss_sha512" with public key OID RSASSA-PSS (id: 0x080b).
static SignatureAndHashAlgorithm SHA512withRSAPSS_RSAE
          SignatureAndHashAlgorithm "rsa_pss_rsae_sha512" with public key OID rsaEncryption (id: 0x0806).
 
Constructor Summary
SignatureAndHashAlgorithm(int hashAlgId, int sigAlgId, java.lang.String implementationName)
          Creates a new SignatureAndHashAlgorithm from hash alg, sig alg id, and name.
SignatureAndHashAlgorithm(int hashAlgId, int sigAlgId, java.lang.String implementationName, java.lang.String name)
          Creates a new SignatureAndHashAlgorithm from hash alg, sig alg id, and name.
SignatureAndHashAlgorithm(int id, java.lang.String implementationName)
          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 name of the SignatureAndHashAlgorithm.
 int getVersion()
          Gets the protocol version this SignatureAndHashAlgorithm is used with.
 int hashCode()
          Gets a hashcode of this SigAndHashAlgId object.
 void setVersion(int version)
          Sets the protocol version this SignatureAndHashAlgorithm is used with.
 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).


ED25519

public static final SignatureAndHashAlgorithm ED25519
SignatureAndHashAlgorithm "ED25519" (id: 0x0807).


ED448

public static final SignatureAndHashAlgorithm ED448
SignatureAndHashAlgorithm "ED448" (id: 0x0808).


SHA256withRSAPSS_RSAE

public static final SignatureAndHashAlgorithm SHA256withRSAPSS_RSAE
SignatureAndHashAlgorithm "rsa_pss_rsae_sha256" with public key OID rsaEncryption (id: 0x0804).


SHA384withRSAPSS_RSAE

public static final SignatureAndHashAlgorithm SHA384withRSAPSS_RSAE
SignatureAndHashAlgorithm "rsa_pss_rsae_sha384" with public key OID rsaEncryption (id: 0x0805).


SHA512withRSAPSS_RSAE

public static final SignatureAndHashAlgorithm SHA512withRSAPSS_RSAE
SignatureAndHashAlgorithm "rsa_pss_rsae_sha512" with public key OID rsaEncryption (id: 0x0806).


SHA256withRSAPSS_PSS

public static final SignatureAndHashAlgorithm SHA256withRSAPSS_PSS
SignatureAndHashAlgorithm "rsa_pss_pss_sha256" with public key OID RSASSA-PSS (id: 0x0809).


SHA384withRSAPSS_PSS

public static final SignatureAndHashAlgorithm SHA384withRSAPSS_PSS
SignatureAndHashAlgorithm "rsa_pss_pss_sha384" with public key OID RSASSA-PSS (id: 0x080a).


SHA512withRSAPSS_PSS

public static final SignatureAndHashAlgorithm SHA512withRSAPSS_PSS
SignatureAndHashAlgorithm "rsa_pss_pss_sha512" with public key OID RSASSA-PSS (id: 0x080b).

Constructor Detail

SignatureAndHashAlgorithm

public SignatureAndHashAlgorithm(int hashAlgId,
                                 int sigAlgId,
                                 java.lang.String implementationName)
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
implementationName - the SignatureAndHashAlgorithm implementation 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 hashAlgId,
                                 int sigAlgId,
                                 java.lang.String implementationName,
                                 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
implementationName - the SignatureAndHashAlgorithm implementation name
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 implementationName)
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)
implementationName - the SignatureAndHashAlgorithm implementation 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 name of the SignatureAndHashAlgorithm.

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

getVersion

public int getVersion()
Gets the protocol version this SignatureAndHashAlgorithm is used with. Initially not set. Maybe set during the handshake and used for checking if this SignatureAndHashAlgorithm can be used with a specific key for the current protocol version.


setVersion

public void setVersion(int version)
Sets the protocol version this SignatureAndHashAlgorithm is used with. Initially not set. Maybe set during the handshake and used for checking if this SignatureAndHashAlgorithm can be used with a specific key for the current protocol version.

Parameters:
version - the current protocol version

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 6.0, (c) 2002 IAIK, (c) 2003 - 2015 SIC