public class SignatureAndHashAlgorithm
extends java.lang.Object
implements java.lang.Cloneable
Note that TLS 1.3 (RFC 8446) replaces the SignatureAndHashAlgorithm
type by the
type. For
compatibility reasons iSaSiLk can be used with both types, SignatureAndHashAlgorithm and
SignatureScheme.
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:
SHA256withRSA
(id:
0x0401)SHA256withECDSA
(id:
0x0403)SHA256withDSA
(id:
0x0402)SHA512withRSA
(id:
0x0601)SHA512withECDSA
(id:
0x0603)SHA512withDSA
(id:
0x0602)SHA384withRSA
(id:
0x0501)SHA384withECDSA
(id:
0x0503)SHA384withDSA
(id:
0x0502)SHA224withRSA
(id:
0x0301)SHA224withECDSA
(id:
0x0303)SHA224withDSA
(id:
0x0302)SHA1withRSA
(id: 0x0201)SHA1withECDSA
(id: 0x0203)SHA1withDSA
(id: 0x0202)MD5withRSA
(id: 0x0101)ED25519
(id: 0x0807)ED448
(id: 0x0808)SHA256withRSAPSS_RSAE
(id: 0x0804)SHA384withRSAPSS_RSAE
(id: 0x0805)SHA512withRSAPSS_RSAE
(id: 0x0806)SHA256withRSAPSS_PSS
(id: 0x0809)SHA384withRSAPSS_PSS
(id: 0x080a)SHA512withRSAPSS_PSS
(id: 0x080b)SignatureAlgorithms
,
SignatureAndHashAlgorithmList
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final SignatureAndHashAlgorithm MD5withRSA
public static final SignatureAndHashAlgorithm SHA1withRSA
public static final SignatureAndHashAlgorithm SHA224withRSA
public static final SignatureAndHashAlgorithm SHA256withRSA
public static final SignatureAndHashAlgorithm SHA384withRSA
public static final SignatureAndHashAlgorithm SHA512withRSA
public static final SignatureAndHashAlgorithm SHA1withDSA
public static final SignatureAndHashAlgorithm SHA224withDSA
public static final SignatureAndHashAlgorithm SHA256withDSA
public static final SignatureAndHashAlgorithm SHA384withDSA
public static final SignatureAndHashAlgorithm SHA512withDSA
public static final SignatureAndHashAlgorithm SHA1withECDSA
public static final SignatureAndHashAlgorithm SHA224withECDSA
public static final SignatureAndHashAlgorithm SHA256withECDSA
public static final SignatureAndHashAlgorithm SHA384withECDSA
public static final SignatureAndHashAlgorithm SHA512withECDSA
public static final SignatureAndHashAlgorithm ED25519
public static final SignatureAndHashAlgorithm ED448
public static final SignatureAndHashAlgorithm SHA256withRSAPSS_RSAE
public static final SignatureAndHashAlgorithm SHA384withRSAPSS_RSAE
public static final SignatureAndHashAlgorithm SHA512withRSAPSS_RSAE
public static final SignatureAndHashAlgorithm SHA256withRSAPSS_PSS
public static final SignatureAndHashAlgorithm SHA384withRSAPSS_PSS
public static final SignatureAndHashAlgorithm SHA512withRSAPSS_PSS
public SignatureAndHashAlgorithm(int hashAlgId, int sigAlgId, java.lang.String implementationName)
hashAlgId
- the hash algorithm id value as intsigAlgId
- the signature algorithm id value as intimplementationName
- the SignatureAndHashAlgorithm implementation namejava.lang.IllegalArgumentException
- if the id type value is out of range (not between [0x00 0x00]
and [0xFF 0xFF])public SignatureAndHashAlgorithm(int hashAlgId, int sigAlgId, java.lang.String implementationName, java.lang.String name)
hashAlgId
- the hash algorithm id value as intsigAlgId
- the signature algorithm id value as intimplementationName
- the SignatureAndHashAlgorithm implementation namename
- the SignatureAndHashAlgorithm namejava.lang.IllegalArgumentException
- if the id type value is out of range (not between [0x00 0x00]
and [0xFF 0xFF])public SignatureAndHashAlgorithm(int id, java.lang.String implementationName)
id
- the SignatureAndHashAlgorithm algorithm id value as int
(comprising hash alg id and sig alg id; two uint8 values)implementationName
- the SignatureAndHashAlgorithm implementation namejava.lang.IllegalArgumentException
- if the id type value is out of range (not between [0x00 0x00]
and [0xFF 0xFF])public int getId()
public java.lang.String getName()
Unkown
" if
no name has been assigned to this SigAndHashAlgIdpublic int getVersion()
public void setVersion(int version)
version
- the current protocol versionpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to compare this SigAndHashAlgId
against.true
, if the given object is equal to this
SigAndHashAlgId
, false
otherwisepublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(boolean detailed)
detailed
- whether to include the hash/signature id values