Enum Class SignatureScheme

java.lang.Object
java.lang.Enum<SignatureScheme>
io.github.mahmoudimus.quic.tls.SignatureScheme
All Implemented Interfaces:
Serializable, Comparable<SignatureScheme>, Constable

public enum SignatureScheme extends Enum<SignatureScheme>
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.
  • Enum Constant Details

    • ECDSA_SECP256R1_SHA256

      public static final SignatureScheme ECDSA_SECP256R1_SHA256
      ECDSA on P-256 with SHA-256.
    • ECDSA_SECP384R1_SHA384

      public static final SignatureScheme ECDSA_SECP384R1_SHA384
      ECDSA on P-384 with SHA-384.
    • RSA_PSS_RSAE_SHA256

      public static final SignatureScheme RSA_PSS_RSAE_SHA256
      RSASSA-PSS with SHA-256, for an rsaEncryption key.
    • RSA_PSS_RSAE_SHA384

      public static final SignatureScheme RSA_PSS_RSAE_SHA384
      RSASSA-PSS with SHA-384, for an rsaEncryption key.
    • RSA_PSS_RSAE_SHA512

      public static final SignatureScheme RSA_PSS_RSAE_SHA512
      RSASSA-PSS with SHA-512, for an rsaEncryption key.
    • ED25519

      public static final SignatureScheme ED25519
      Ed25519 (RFC 8032).
    • RSA_PKCS1_SHA256

      public static final SignatureScheme RSA_PKCS1_SHA256
      RSASSA-PKCS1-v1_5 with SHA-256: certificate signatures only.
    • RSA_PKCS1_SHA384

      public static final SignatureScheme RSA_PKCS1_SHA384
      RSASSA-PKCS1-v1_5 with SHA-384: certificate signatures only.
    • RSA_PKCS1_SHA512

      public static final SignatureScheme RSA_PKCS1_SHA512
      RSASSA-PKCS1-v1_5 with SHA-512: certificate signatures only.
  • Method Details

    • values

      public static SignatureScheme[] 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

      public static SignatureScheme valueOf(String name)
      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 name
      NullPointerException - 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 a CertificateVerify message.
      Returns:
      false for the rsa_pkcs1 schemes
    • compatibleWith

      public boolean compatibleWith(Key key)
      Whether a key (public or private) can make or check this scheme's signatures: an EC key on the scheme's curve, an rsaEncryption RSA key, or an Ed25519 key.
      Parameters:
      key - the key
      Returns:
      true if the key fits the scheme
    • forCode

      public static SignatureScheme forCode(int code)
      The scheme with a TLS code point.
      Parameters:
      code - the code point
      Returns:
      the scheme, or null if it is not one of these