Package io.github.mahmoudimus.quic.tls
Enum Class SignatureScheme
- All Implemented Interfaces:
Serializable,Comparable<SignatureScheme>,Constable
The signature schemes (RFC 8446 section 4.2.3) the handshake knows. All but the
rsa_pkcs1 schemes can sign a TLS 1.3 CertificateVerify; the rsa_pkcs1 ones are
only advertised for the signatures in certificate chains, as RFC 8446 requires.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionECDSA on P-256 with SHA-256.ECDSA on P-384 with SHA-384.Ed25519 (RFC 8032).RSASSA-PKCS1-v1_5 with SHA-256: certificate signatures only.RSASSA-PKCS1-v1_5 with SHA-384: certificate signatures only.RSASSA-PKCS1-v1_5 with SHA-512: certificate signatures only.RSASSA-PSS with SHA-256, for anrsaEncryptionkey.RSASSA-PSS with SHA-384, for anrsaEncryptionkey.RSASSA-PSS with SHA-512, for anrsaEncryptionkey. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether TLS 1.3 allows the scheme in aCertificateVerifymessage.intcode()The scheme's TLS code point.booleancompatibleWith(Key key) Whether a key (public or private) can make or check this scheme's signatures: an EC key on the scheme's curve, anrsaEncryptionRSA key, or an Ed25519 key.static SignatureSchemeforCode(int code) The scheme with a TLS code point.static SignatureSchemeReturns the enum constant of this class with the specified name.static SignatureScheme[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ECDSA_SECP256R1_SHA256
ECDSA on P-256 with SHA-256. -
ECDSA_SECP384R1_SHA384
ECDSA on P-384 with SHA-384. -
RSA_PSS_RSAE_SHA256
RSASSA-PSS with SHA-256, for anrsaEncryptionkey. -
RSA_PSS_RSAE_SHA384
RSASSA-PSS with SHA-384, for anrsaEncryptionkey. -
RSA_PSS_RSAE_SHA512
RSASSA-PSS with SHA-512, for anrsaEncryptionkey. -
ED25519
Ed25519 (RFC 8032). -
RSA_PKCS1_SHA256
RSASSA-PKCS1-v1_5 with SHA-256: certificate signatures only. -
RSA_PKCS1_SHA384
RSASSA-PKCS1-v1_5 with SHA-384: certificate signatures only. -
RSA_PKCS1_SHA512
RSASSA-PKCS1-v1_5 with SHA-512: certificate signatures only.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
code
public int code()The scheme's TLS code point.- Returns:
- the two-byte code, such as
0x0403
-
allowedInCertificateVerify
public boolean allowedInCertificateVerify()Whether TLS 1.3 allows the scheme in aCertificateVerifymessage.- Returns:
- false for the
rsa_pkcs1schemes
-
compatibleWith
Whether a key (public or private) can make or check this scheme's signatures: an EC key on the scheme's curve, anrsaEncryptionRSA key, or an Ed25519 key.- Parameters:
key- the key- Returns:
- true if the key fits the scheme
-
forCode
The scheme with a TLS code point.- Parameters:
code- the code point- Returns:
- the scheme, or null if it is not one of these
-