Package eu.europa.esig.dss.enumerations
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 Summary
Enum Constants Enum Constant Description DSA_RAWDSA without digest algorithmDSA_SHA1DSA with SHA-1DSA_SHA224DSA with SHA-224DSA_SHA256DSA with SHA-256DSA_SHA3_224DSA with SHA3-224DSA_SHA3_256DSA with SHA3-256DSA_SHA3_384DSA with SHA3-384DSA_SHA3_512DSA with SHA3-512DSA_SHA384DSA with SHA-384DSA_SHA512DSA with SHA-512ECDSA_RAWECDSA without digest algorithmECDSA_RIPEMD160ECDSA with RIPEMD160ECDSA_SHA1ECDSA with SHA-1ECDSA_SHA224ECDSA with SHA-224ECDSA_SHA256ECDSA with SHA-256ECDSA_SHA3_224ECDSA with SHA3-224ECDSA_SHA3_256ECDSA with SHA3-256ECDSA_SHA3_384ECDSA with SHA3-384ECDSA_SHA3_512ECDSA with SHA3-512ECDSA_SHA384ECDSA with SHA-384ECDSA_SHA512ECDSA with SHA-512ED25519EDDSA with SHA512ED448EDDSA with SHAKE256-512HMAC_RIPEMD160HMAC with RIPEMD160HMAC_SHA1HMAC with SHA-1HMAC_SHA224HMAC with SHA-224HMAC_SHA256HMAC with SHA-256HMAC_SHA3_224HMAC with SHA3-224HMAC_SHA3_256HMAC with SHA3-256HMAC_SHA3_384HMAC with SHA3-384HMAC_SHA3_512HMAC with SHA3-512HMAC_SHA384HMAC with SHA-384HMAC_SHA512HMAC with SHA-512PLAIN_ECDSA_RIPEMD160PLAIN-ECDSA with RIPEMD160PLAIN_ECDSA_SHA1PLAIN-ECDSA with SHA-1PLAIN_ECDSA_SHA224PLAIN-ECDSA with SHA-224PLAIN_ECDSA_SHA256PLAIN-ECDSA with SHA-256PLAIN_ECDSA_SHA3_224PLAIN-ECDSA with SHA3-224PLAIN_ECDSA_SHA3_256PLAIN-ECDSA with SHA3-256PLAIN_ECDSA_SHA3_384PLAIN-ECDSA with SHA3-384PLAIN_ECDSA_SHA3_512PLAIN-ECDSA with SHA3-512PLAIN_ECDSA_SHA384PLAIN-ECDSA with SHA-384PLAIN_ECDSA_SHA512PLAIN-ECDSA with SHA-512RSA_MD2RSA with MD2RSA_MD5RSA with MD5RSA_RAWRSA without digest algorithmRSA_RIPEMD160RSA with RIPEMD160RSA_SHA1RSA with SHA-1RSA_SHA224RSA with SHA-224RSA_SHA256RSA with SHA-256RSA_SHA3_224RSA with SHA3-224RSA_SHA3_256RSA with SHA3-256RSA_SHA3_384RSA with SHA3-384RSA_SHA3_512RSA with SHA3-512RSA_SHA384RSA with SHA-384RSA_SHA512RSA with SHA-512RSA_SSA_PSS_RAW_MGF1RSA with MGF1 without digest algorithmRSA_SSA_PSS_SHA1_MGF1RSA with MGF1 with SHA-1RSA_SSA_PSS_SHA224_MGF1RSA with MGF1 with SHA-224RSA_SSA_PSS_SHA256_MGF1RSA with MGF1 with SHA-256RSA_SSA_PSS_SHA3_224_MGF1RSA with MGF1 with SHA3-224RSA_SSA_PSS_SHA3_256_MGF1RSA with MGF1 with SHA3-256RSA_SSA_PSS_SHA3_384_MGF1RSA with MGF1 with SHA3-384RSA_SSA_PSS_SHA3_512_MGF1RSA with MGF1 with SHA3-512RSA_SSA_PSS_SHA384_MGF1RSA with MGF1 with SHA-384RSA_SSA_PSS_SHA512_MGF1RSA with MGF1 with SHA-512
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SignatureAlgorithmforJAVA(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.static SignatureAlgorithmforJWA(String jsonWebAlgorithm)Returns a correspondingSignatureAlgorithmby the JWA namestatic SignatureAlgorithmforJWA(String jsonWebAlgorithm, SignatureAlgorithm defaultValue)This method return theSignatureAlgorithmor the default value if the algorithm is unknown.static SignatureAlgorithmforOID(String oid)Returns a correspondingSignatureAlgorithmby the OIDstatic SignatureAlgorithmforOidAndParams(String oid, byte[] sigAlgParams)Returns a correspondingSignatureAlgorithmby the OID and signature algorithm parametersstatic SignatureAlgorithmforXML(String xmlName)Returns a correspondingSignatureAlgorithmby the XML URI stringstatic SignatureAlgorithmforXML(String xmlName, SignatureAlgorithm defaultValue)This method return theSignatureAlgorithmor the default value if the algorithm is unknown.static SignatureAlgorithmgetAlgorithm(EncryptionAlgorithm encryptionAlgorithm, DigestAlgorithm digestAlgorithm)For given encryption algorithm and digest algorithm this function returns the signature algorithm.static SignatureAlgorithmgetAlgorithm(EncryptionAlgorithm encryptionAlgorithm, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf)For given encryption algorithm and digest algorithm this function returns the signature algorithm.DigestAlgorithmgetDigestAlgorithm()This method returns the digest algorithm.EncryptionAlgorithmgetEncryptionAlgorithm()This method returns the encryption algorithm.StringgetJCEId()Returns algorithm identifier corresponding to JAVA JCE class names.StringgetJWAId()Returns algorithm identifier corresponding to JWA accepted algorithms (RFC 7518)MaskGenerationFunctiongetMaskGenerationFunction()This method returns the mask generation function.StringgetName()Returns user-friendly name for the signature algorithmStringgetOid()Returns the OID of the signature algorithm.StringgetUri()Returns the XML ID of the signature algorithm.StringgetURIBasedOnOID()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"static SignatureAlgorithmvalueOf(String name)Returns the enum constant of this type with the specified name.static SignatureAlgorithm[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 Detail
-
values
public static SignatureAlgorithm[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SignatureAlgorithm c : SignatureAlgorithm.values()) System.out.println(c);
- 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 nameNullPointerException- if the argument is null
-
forXML
public static SignatureAlgorithm forXML(String xmlName)
Returns a correspondingSignatureAlgorithmby the XML URI string- Parameters:
xmlName-StringXML URI- Returns:
SignatureAlgorithm
-
forXML
public static SignatureAlgorithm forXML(String xmlName, SignatureAlgorithm defaultValue)
This method return theSignatureAlgorithmor the default value if the algorithm is unknown.- Parameters:
xmlName- XML URI of the given algorithmdefaultValue- the default value to be returned if not found- Returns:
SignatureAlgorithmor default value
-
forOID
public static SignatureAlgorithm forOID(String oid)
Returns a correspondingSignatureAlgorithmby the OID- Parameters:
oid-String- Returns:
SignatureAlgorithm
-
forOidAndParams
public static SignatureAlgorithm forOidAndParams(String oid, byte[] sigAlgParams)
Returns a correspondingSignatureAlgorithmby the OID and signature algorithm parameters- Parameters:
oid-StringsigAlgParams- a byte array of signature algorithm parameters- Returns:
SignatureAlgorithm
-
forJWA
public static SignatureAlgorithm forJWA(String jsonWebAlgorithm)
Returns a correspondingSignatureAlgorithmby the JWA name- Parameters:
jsonWebAlgorithm-StringJWA algorithm Id- Returns:
SignatureAlgorithm
-
forJWA
public static SignatureAlgorithm forJWA(String jsonWebAlgorithm, SignatureAlgorithm defaultValue)
This method return theSignatureAlgorithmor the default value if the algorithm is unknown.- Parameters:
jsonWebAlgorithm-StringJWA algorithm IddefaultValue- the default value to be returned if not found- Returns:
SignatureAlgorithmor 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 algorithmdigestAlgorithm- 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 algorithmdigestAlgorithm- the digest algorithmmgf- 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:
getUriin interfaceUriBasedEnum- Returns:
- the XML URI for the current signature algorithm.
-
getOid
public String getOid()
Returns the OID of the signature algorithm.- Specified by:
getOidin interfaceOidBasedEnum- 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
-
-