Enum SignatureAlgorithm

java.lang.Object
java.lang.Enum<SignatureAlgorithm>
eu.europa.esig.dss.enumerations.SignatureAlgorithm
All Implemented Interfaces:
OidAndUriBasedEnum, OidBasedEnum, UriBasedEnum, Serializable, Comparable<SignatureAlgorithm>

public enum SignatureAlgorithm extends Enum<SignatureAlgorithm> implements OidAndUriBasedEnum
Supported signature algorithms.
  • Enum Constant Details

    • RSA_RAW

      public static final SignatureAlgorithm RSA_RAW
      RSA without digest algorithm
    • RSA_SHA1

      public static final SignatureAlgorithm RSA_SHA1
      RSA with SHA-1
    • RSA_SHA224

      public static final SignatureAlgorithm RSA_SHA224
      RSA with SHA-224
    • RSA_SHA256

      public static final SignatureAlgorithm RSA_SHA256
      RSA with SHA-256
    • RSA_SHA384

      public static final SignatureAlgorithm RSA_SHA384
      RSA with SHA-384
    • RSA_SHA512

      public static final SignatureAlgorithm RSA_SHA512
      RSA with SHA-512
    • RSA_SHA3_224

      public static final SignatureAlgorithm RSA_SHA3_224
      RSA with SHA3-224
    • RSA_SHA3_256

      public static final SignatureAlgorithm RSA_SHA3_256
      RSA with SHA3-256
    • RSA_SHA3_384

      public static final SignatureAlgorithm RSA_SHA3_384
      RSA with SHA3-384
    • RSA_SHA3_512

      public static final SignatureAlgorithm RSA_SHA3_512
      RSA with SHA3-512
    • RSA_SSA_PSS_RAW_MGF1

      public static final SignatureAlgorithm RSA_SSA_PSS_RAW_MGF1
      RSA with MGF1 without digest algorithm
    • RSA_SSA_PSS_SHA1_MGF1

      public static final SignatureAlgorithm RSA_SSA_PSS_SHA1_MGF1
      RSA with MGF1 with SHA-1
    • RSA_SSA_PSS_SHA224_MGF1

      public static final SignatureAlgorithm RSA_SSA_PSS_SHA224_MGF1
      RSA with MGF1 with SHA-224
    • RSA_SSA_PSS_SHA256_MGF1

      public static final SignatureAlgorithm RSA_SSA_PSS_SHA256_MGF1
      RSA with MGF1 with SHA-256
    • RSA_SSA_PSS_SHA384_MGF1

      public static final SignatureAlgorithm RSA_SSA_PSS_SHA384_MGF1
      RSA with MGF1 with SHA-384
    • RSA_SSA_PSS_SHA512_MGF1

      public static final SignatureAlgorithm RSA_SSA_PSS_SHA512_MGF1
      RSA with MGF1 with SHA-512
    • RSA_SSA_PSS_SHA3_224_MGF1

      public static final SignatureAlgorithm RSA_SSA_PSS_SHA3_224_MGF1
      RSA with MGF1 with SHA3-224
    • RSA_SSA_PSS_SHA3_256_MGF1

      public static final SignatureAlgorithm RSA_SSA_PSS_SHA3_256_MGF1
      RSA with MGF1 with SHA3-256
    • RSA_SSA_PSS_SHA3_384_MGF1

      public static final SignatureAlgorithm RSA_SSA_PSS_SHA3_384_MGF1
      RSA with MGF1 with SHA3-384
    • RSA_SSA_PSS_SHA3_512_MGF1

      public static final SignatureAlgorithm RSA_SSA_PSS_SHA3_512_MGF1
      RSA with MGF1 with SHA3-512
    • RSA_RIPEMD160

      public static final SignatureAlgorithm RSA_RIPEMD160
      RSA with RIPEMD160
    • RSA_MD2

      public static final SignatureAlgorithm RSA_MD2
      RSA with MD2
    • RSA_MD5

      public static final SignatureAlgorithm RSA_MD5
      RSA with MD5
    • ECDSA_RAW

      public static final SignatureAlgorithm ECDSA_RAW
      ECDSA without digest algorithm
    • ECDSA_SHA1

      public static final SignatureAlgorithm ECDSA_SHA1
      ECDSA with SHA-1
    • ECDSA_SHA224

      public static final SignatureAlgorithm ECDSA_SHA224
      ECDSA with SHA-224
    • ECDSA_SHA256

      public static final SignatureAlgorithm ECDSA_SHA256
      ECDSA with SHA-256
    • ECDSA_SHA384

      public static final SignatureAlgorithm ECDSA_SHA384
      ECDSA with SHA-384
    • ECDSA_SHA512

      public static final SignatureAlgorithm ECDSA_SHA512
      ECDSA with SHA-512
    • ECDSA_SHA3_224

      public static final SignatureAlgorithm ECDSA_SHA3_224
      ECDSA with SHA3-224
    • ECDSA_SHA3_256

      public static final SignatureAlgorithm ECDSA_SHA3_256
      ECDSA with SHA3-256
    • ECDSA_SHA3_384

      public static final SignatureAlgorithm ECDSA_SHA3_384
      ECDSA with SHA3-384
    • ECDSA_SHA3_512

      public static final SignatureAlgorithm ECDSA_SHA3_512
      ECDSA with SHA3-512
    • ECDSA_RIPEMD160

      public static final SignatureAlgorithm ECDSA_RIPEMD160
      ECDSA with RIPEMD160
    • PLAIN_ECDSA_SHA1

      public static final SignatureAlgorithm PLAIN_ECDSA_SHA1
      PLAIN-ECDSA with SHA-1
    • PLAIN_ECDSA_SHA224

      public static final SignatureAlgorithm PLAIN_ECDSA_SHA224
      PLAIN-ECDSA with SHA-224
    • PLAIN_ECDSA_SHA256

      public static final SignatureAlgorithm PLAIN_ECDSA_SHA256
      PLAIN-ECDSA with SHA-256
    • PLAIN_ECDSA_SHA384

      public static final SignatureAlgorithm PLAIN_ECDSA_SHA384
      PLAIN-ECDSA with SHA-384
    • PLAIN_ECDSA_SHA512

      public static final SignatureAlgorithm PLAIN_ECDSA_SHA512
      PLAIN-ECDSA with SHA-512
    • PLAIN_ECDSA_SHA3_224

      public static final SignatureAlgorithm PLAIN_ECDSA_SHA3_224
      PLAIN-ECDSA with SHA3-224
    • PLAIN_ECDSA_SHA3_256

      public static final SignatureAlgorithm PLAIN_ECDSA_SHA3_256
      PLAIN-ECDSA with SHA3-256
    • PLAIN_ECDSA_SHA3_384

      public static final SignatureAlgorithm PLAIN_ECDSA_SHA3_384
      PLAIN-ECDSA with SHA3-384
    • PLAIN_ECDSA_SHA3_512

      public static final SignatureAlgorithm PLAIN_ECDSA_SHA3_512
      PLAIN-ECDSA with SHA3-512
    • PLAIN_ECDSA_RIPEMD160

      public static final SignatureAlgorithm PLAIN_ECDSA_RIPEMD160
      PLAIN-ECDSA with RIPEMD160
    • DSA_RAW

      public static final SignatureAlgorithm DSA_RAW
      DSA without digest algorithm
    • DSA_SHA1

      public static final SignatureAlgorithm DSA_SHA1
      DSA with SHA-1
    • DSA_SHA224

      public static final SignatureAlgorithm DSA_SHA224
      DSA with SHA-224
    • DSA_SHA256

      public static final SignatureAlgorithm DSA_SHA256
      DSA with SHA-256
    • DSA_SHA384

      public static final SignatureAlgorithm DSA_SHA384
      DSA with SHA-384
    • DSA_SHA512

      public static final SignatureAlgorithm DSA_SHA512
      DSA with SHA-512
    • DSA_SHA3_224

      public static final SignatureAlgorithm DSA_SHA3_224
      DSA with SHA3-224
    • DSA_SHA3_256

      public static final SignatureAlgorithm DSA_SHA3_256
      DSA with SHA3-256
    • DSA_SHA3_384

      public static final SignatureAlgorithm DSA_SHA3_384
      DSA with SHA3-384
    • DSA_SHA3_512

      public static final SignatureAlgorithm DSA_SHA3_512
      DSA with SHA3-512
    • HMAC_SHA1

      public static final SignatureAlgorithm HMAC_SHA1
      HMAC with SHA-1
    • HMAC_SHA224

      public static final SignatureAlgorithm HMAC_SHA224
      HMAC with SHA-224
    • HMAC_SHA256

      public static final SignatureAlgorithm HMAC_SHA256
      HMAC with SHA-256
    • HMAC_SHA384

      public static final SignatureAlgorithm HMAC_SHA384
      HMAC with SHA-384
    • HMAC_SHA512

      public static final SignatureAlgorithm HMAC_SHA512
      HMAC with SHA-512
    • HMAC_SHA3_224

      public static final SignatureAlgorithm HMAC_SHA3_224
      HMAC with SHA3-224
    • HMAC_SHA3_256

      public static final SignatureAlgorithm HMAC_SHA3_256
      HMAC with SHA3-256
    • HMAC_SHA3_384

      public static final SignatureAlgorithm HMAC_SHA3_384
      HMAC with SHA3-384
    • HMAC_SHA3_512

      public static final SignatureAlgorithm HMAC_SHA3_512
      HMAC with SHA3-512
    • HMAC_RIPEMD160

      public static final SignatureAlgorithm HMAC_RIPEMD160
      HMAC with RIPEMD160
    • ED25519

      public static final SignatureAlgorithm ED25519
      EDDSA with SHA512
    • ED448

      public static final SignatureAlgorithm ED448
      EDDSA with SHAKE256-512
  • Method Details

    • values

      public static SignatureAlgorithm[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static SignatureAlgorithm valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • forXML

      public static SignatureAlgorithm forXML(String xmlName)
      Returns a corresponding SignatureAlgorithm by the XML URI string
      Parameters:
      xmlName - String XML URI
      Returns:
      SignatureAlgorithm
    • forXML

      public static SignatureAlgorithm forXML(String xmlName, SignatureAlgorithm defaultValue)
      This method return the SignatureAlgorithm or the default value if the algorithm is unknown.
      Parameters:
      xmlName - XML URI of the given algorithm
      defaultValue - the default value to be returned if not found
      Returns:
      SignatureAlgorithm or default value
    • forOID

      public static SignatureAlgorithm forOID(String oid)
      Returns a corresponding SignatureAlgorithm by the OID
      Parameters:
      oid - String
      Returns:
      SignatureAlgorithm
    • forOidAndParams

      public static SignatureAlgorithm forOidAndParams(String oid, byte[] sigAlgParams)
      Returns a corresponding SignatureAlgorithm by the OID and signature algorithm parameters
      Parameters:
      oid - String
      sigAlgParams - a byte array of signature algorithm parameters
      Returns:
      SignatureAlgorithm
    • forJWA

      public static SignatureAlgorithm forJWA(String jsonWebAlgorithm)
      Returns a corresponding SignatureAlgorithm by the JWA name
      Parameters:
      jsonWebAlgorithm - String JWA algorithm Id
      Returns:
      SignatureAlgorithm
    • forJWA

      public static SignatureAlgorithm forJWA(String jsonWebAlgorithm, SignatureAlgorithm defaultValue)
      This method return the SignatureAlgorithm or the default value if the algorithm is unknown.
      Parameters:
      jsonWebAlgorithm - String JWA algorithm Id
      defaultValue - the default value to be returned if not found
      Returns:
      SignatureAlgorithm or default value
    • forJAVA

      public static SignatureAlgorithm forJAVA(String javaName)
      For given signature algorithm and digest algorithm this function returns the Java form of the signature algorithm Signature Algorithms The algorithm names in this section can be specified when generating an instance of Signature. NONEwithRSA - The RSA signature algorithm which does not use a digesting algorithm (e.g. MD5/SHA1) before performing the RSA operation. For more information about the RSA Signature algorithms, please see PKCS1. MD2withRSA MD5withRSA - The MD2/MD5 with RSA Encryption signature algorithm which uses the MD2/MD5 digest algorithm and RSA to create and verify RSA digital signatures as defined in PKCS1. SHA1withRSA SHA256withRSA SHA384withRSA SHA512withRSA - The signature algorithm with SHA-* and the RSA encryption algorithm as defined in the OSI Interoperability Workshop, using the padding conventions described in PKCS1. NONEwithDSA - The Digital Signature Algorithm as defined in FIPS PUB 186-2. The data must be exactly 20 bytes in length. This algorithms is also known under the alias name of rawDSA. SHA1withDSA - The DSA with SHA-1 signature algorithm which uses the SHA-1 digest algorithm and DSA to create and verify DSA digital signatures as defined in FIPS PUB 186. NONEwithECDSA SHA1withECDSA SHA256withECDSA SHA384withECDSA SHA512withECDSA (ECDSA) - The ECDSA signature algorithms as defined in ANSI X9.62. Note:"ECDSA" is an ambiguous name for the "SHA1withECDSA" algorithm and should not be used. The formal name "SHA1withECDSA" should be used instead. <digest>with<encryption> - Use this to form a name for a signature algorithm with a particular message digest (such as MD2 or MD5) and algorithm (such as RSA or DSA), just as was done for the explicitly-defined standard names in this section (MD2withRSA, etc.). For the new signature schemes defined in PKCS1 v 2.0, for which the <digest>with<encryption> form is insufficient, <digest>with<encryption>and<mgf> can be used to form a name. Here, <mgf> should be replaced by a mask generation function such as MGF1. Example: MD5withRSAandMGF1.
      Parameters:
      javaName - the java name
      Returns:
      the corresponding SignatureAlgorithm
    • getAlgorithm

      public static SignatureAlgorithm getAlgorithm(EncryptionAlgorithm encryptionAlgorithm, DigestAlgorithm digestAlgorithm)
      For given encryption algorithm and digest algorithm this function returns the signature algorithm.
      Parameters:
      encryptionAlgorithm - the encryption algorithm
      digestAlgorithm - the digest algorithm
      Returns:
      the corresponding combination of both algorithms
    • getAlgorithm

      public static SignatureAlgorithm getAlgorithm(EncryptionAlgorithm encryptionAlgorithm, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf)
      For given encryption algorithm and digest algorithm this function returns the signature algorithm.
      Parameters:
      encryptionAlgorithm - the encryption algorithm
      digestAlgorithm - the digest algorithm
      mgf - the mask generation function
      Returns:
      the corresponding combination of both algorithms
    • getEncryptionAlgorithm

      public EncryptionAlgorithm getEncryptionAlgorithm()
      This method returns the encryption algorithm.
      Returns:
      the encryption algorithm
    • getDigestAlgorithm

      public DigestAlgorithm getDigestAlgorithm()
      This method returns the digest algorithm.
      Returns:
      the digest algorithm
    • getMaskGenerationFunction

      public MaskGenerationFunction getMaskGenerationFunction()
      This method returns the mask generation function.
      Returns:
      the mask generation function
    • getUri

      public String getUri()
      Returns the XML ID of the signature algorithm.
      Specified by:
      getUri in interface UriBasedEnum
      Returns:
      the XML URI for the current signature algorithm.
    • getOid

      public String getOid()
      Returns the OID of the signature algorithm.
      Specified by:
      getOid in interface OidBasedEnum
      Returns:
      the OID for the current signature algorithm.
    • getURIBasedOnOID

      public String getURIBasedOnOID()
      Returns the URI of the signature algorithm generated from its OID: Ex.: OID = 1.2.4.5.6.8 becomes URI = urn:oid:1.2.4.5.6.8 Note: see RFC 3061 "A URN Namespace of Object Identifiers"
      Returns:
      URI based on the algorithm's OID
    • getJCEId

      public String getJCEId()
      Returns algorithm identifier corresponding to JAVA JCE class names.
      Returns:
      the java name for the current signature algorithm.
    • getJWAId

      public String getJWAId()
      Returns algorithm identifier corresponding to JWA accepted algorithms (RFC 7518)
      Returns:
      the JWA algorithm identifier
    • getName

      public String getName()
      Returns user-friendly name for the signature algorithm
      Returns:
      String name