Package eu.europa.esig.dss.enumerations
Enum SignatureAlgorithm
- All Implemented Interfaces:
OidAndUriBasedEnum
,OidBasedEnum
,UriBasedEnum
,Serializable
,Comparable<SignatureAlgorithm>
public enum SignatureAlgorithm extends Enum<SignatureAlgorithm> implements OidAndUriBasedEnum
Supported signature algorithms.
-
Enum Constant Summary
-
Method Summary
Modifier and Type Method Description 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.static SignatureAlgorithm
forOID(String oid)
static SignatureAlgorithm
forOidAndParams(String oid, byte[] sigAlgParams)
static SignatureAlgorithm
forXML(String xmlName)
static SignatureAlgorithm
forXML(String xmlName, SignatureAlgorithm defaultValue)
This method return theSignatureAlgorithm
or the default value if the algorithm is unknown.static SignatureAlgorithm
getAlgorithm(EncryptionAlgorithm encryptionAlgorithm, DigestAlgorithm digestAlgorithm)
For given encryption algorithm and digest algorithm this function returns the signature algorithm.static SignatureAlgorithm
getAlgorithm(EncryptionAlgorithm encryptionAlgorithm, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf)
For given encryption algorithm and digest algorithm this function returns the signature algorithm.DigestAlgorithm
getDigestAlgorithm()
This method returns the digest algorithm.EncryptionAlgorithm
getEncryptionAlgorithm()
This method returns the encryption algorithm.String
getJCEId()
Returns algorithm identifier corresponding to JAVA JCE class names.MaskGenerationFunction
getMaskGenerationFunction()
This method returns the mask generation function.String
getOid()
Returns the OID of the signature algorithm.String
getUri()
Returns the XML ID of the signature algorithm.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"static SignatureAlgorithm
valueOf(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 Details
-
RSA_RAW
-
RSA_SHA1
-
RSA_SHA224
-
RSA_SHA256
-
RSA_SHA384
-
RSA_SHA512
-
RSA_SHA3_224
-
RSA_SHA3_256
-
RSA_SHA3_384
-
RSA_SHA3_512
-
RSA_SSA_PSS_RAW_MGF1
-
RSA_SSA_PSS_SHA1_MGF1
-
RSA_SSA_PSS_SHA224_MGF1
-
RSA_SSA_PSS_SHA256_MGF1
-
RSA_SSA_PSS_SHA384_MGF1
-
RSA_SSA_PSS_SHA512_MGF1
-
RSA_SSA_PSS_SHA3_224_MGF1
-
RSA_SSA_PSS_SHA3_256_MGF1
-
RSA_SSA_PSS_SHA3_384_MGF1
-
RSA_SSA_PSS_SHA3_512_MGF1
-
RSA_RIPEMD160
-
RSA_MD5
-
RSA_MD2
-
ECDSA_RAW
-
ECDSA_SHA1
-
ECDSA_SHA224
-
ECDSA_SHA256
-
ECDSA_SHA384
-
ECDSA_SHA512
-
ECDSA_SHA3_224
-
ECDSA_SHA3_256
-
ECDSA_SHA3_384
-
ECDSA_SHA3_512
-
ECDSA_RIPEMD160
-
PLAIN_ECDSA_SHA1
-
PLAIN_ECDSA_SHA224
-
PLAIN_ECDSA_SHA256
-
PLAIN_ECDSA_SHA384
-
PLAIN_ECDSA_SHA512
-
PLAIN_ECDSA_RIPEMD160
-
DSA_RAW
-
DSA_SHA1
-
DSA_SHA224
-
DSA_SHA256
-
DSA_SHA384
-
DSA_SHA512
-
DSA_SHA3_224
-
DSA_SHA3_256
-
DSA_SHA3_384
-
DSA_SHA3_512
-
HMAC_SHA1
-
HMAC_SHA224
-
HMAC_SHA256
-
HMAC_SHA384
-
HMAC_SHA512
-
HMAC_SHA3_224
-
HMAC_SHA3_256
-
HMAC_SHA3_384
-
HMAC_SHA3_512
-
HMAC_RIPEMD160
-
ED25519
-
ED448
-
-
Method Details
-
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
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
-
forXML
This method return theSignatureAlgorithm
or 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:
SignatureAlgorithm
or default value
-
forOID
-
forOidAndParams
-
forJAVA
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
This method returns the encryption algorithm.- Returns:
- the encryption algorithm
-
getDigestAlgorithm
This method returns the digest algorithm.- Returns:
- the digest algorithm
-
getMaskGenerationFunction
This method returns the mask generation function.- Returns:
- the mask generation function
-
getUri
Returns the XML ID of the signature algorithm.- Specified by:
getUri
in interfaceUriBasedEnum
- Returns:
- the XML URI for the current signature algorithm.
-
getOid
Returns the OID of the signature algorithm.- Specified by:
getOid
in interfaceOidBasedEnum
- Returns:
- the OID for the current signature algorithm.
-
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
Returns algorithm identifier corresponding to JAVA JCE class names.- Returns:
- the java name for the current signature algorithm.
-