Enum Class SignatureAlgorithm
- All Implemented Interfaces:
OidAndUriBasedEnum
,OidBasedEnum
,UriBasedEnum
,Serializable
,Comparable<SignatureAlgorithm>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDSA without digest algorithmDSA with SHA-1DSA with SHA-224DSA with SHA-256DSA with SHA3-224DSA with SHA3-256DSA with SHA3-384DSA with SHA3-512DSA with SHA-384DSA with SHA-512ECDSA without digest algorithmECDSA with RIPEMD160ECDSA with SHA-1ECDSA with SHA-224ECDSA with SHA-256ECDSA with SHA3-224ECDSA with SHA3-256ECDSA with SHA3-384ECDSA with SHA3-512ECDSA with SHA-384ECDSA with SHA-512EDDSA with SHA512EDDSA with SHAKE256-512HMAC with RIPEMD160HMAC with SHA-1HMAC with SHA-224HMAC with SHA-256HMAC with SHA3-224HMAC with SHA3-256HMAC with SHA3-384HMAC with SHA3-512HMAC with SHA-384HMAC with SHA-512PLAIN-ECDSA with RIPEMD160PLAIN-ECDSA with SHA-1PLAIN-ECDSA with SHA-224PLAIN-ECDSA with SHA-256PLAIN-ECDSA with SHA3-224PLAIN-ECDSA with SHA3-256PLAIN-ECDSA with SHA3-384PLAIN-ECDSA with SHA3-512PLAIN-ECDSA with SHA-384PLAIN-ECDSA with SHA-512RSA with MD2RSA with MD5RSA without digest algorithmRSA with RIPEMD160RSA with SHA-1RSA with SHA-224RSA with SHA-256RSA with SHA3-224RSA with SHA3-256RSA with SHA3-384RSA with SHA3-512RSA with SHA-384RSA with SHA-512RSA with MGF1 without digest algorithmRSA with MGF1 with SHA-1RSA with MGF1 with SHA-224RSA with MGF1 with SHA-256RSA with MGF1 with SHA3-224RSA with MGF1 with SHA3-256RSA with MGF1 with SHA3-384RSA with MGF1 with SHA3-512RSA with MGF1 with SHA-384RSA with MGF1 with SHA-512 -
Method Summary
Modifier and TypeMethodDescriptionstatic SignatureAlgorithm
For given signature algorithm and digest algorithm this function returns the Java form of the signature algorithm Signature Algorithmsstatic SignatureAlgorithm
Returns a correspondingSignatureAlgorithm
by the JWA namestatic SignatureAlgorithm
forJWA
(String jsonWebAlgorithm, SignatureAlgorithm defaultValue) This method return theSignatureAlgorithm
or the default value if the algorithm is unknown.static SignatureAlgorithm
Returns a correspondingSignatureAlgorithm
by the OIDstatic SignatureAlgorithm
forOidAndParams
(String oid, byte[] sigAlgParams) Returns a correspondingSignatureAlgorithm
by the OID and signature algorithm parametersstatic SignatureAlgorithm
Returns a correspondingSignatureAlgorithm
by the XML URI stringstatic 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) Deprecated.since DSS 6.1.This method returns the digest algorithm.This method returns the encryption algorithm.getJCEId()
Returns algorithm identifier corresponding to JAVA JCE class names.getJWAId()
Returns algorithm identifier corresponding to JWA accepted algorithms (RFC 7518)Deprecated.since DSS 6.1.getName()
Returns user-friendly name for the signature algorithmgetOid()
Returns the OID of the signature algorithm.getUri()
Returns the XML ID of the signature algorithm.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
Returns the enum constant of this class with the specified name.static SignatureAlgorithm[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RSA_RAW
RSA without digest algorithm -
RSA_SHA1
RSA with SHA-1 -
RSA_SHA224
RSA with SHA-224 -
RSA_SHA256
RSA with SHA-256 -
RSA_SHA384
RSA with SHA-384 -
RSA_SHA512
RSA with SHA-512 -
RSA_SHA3_224
RSA with SHA3-224 -
RSA_SHA3_256
RSA with SHA3-256 -
RSA_SHA3_384
RSA with SHA3-384 -
RSA_SHA3_512
RSA with SHA3-512 -
RSA_SSA_PSS_RAW_MGF1
RSA with MGF1 without digest algorithm -
RSA_SSA_PSS_SHA1_MGF1
RSA with MGF1 with SHA-1 -
RSA_SSA_PSS_SHA224_MGF1
RSA with MGF1 with SHA-224 -
RSA_SSA_PSS_SHA256_MGF1
RSA with MGF1 with SHA-256 -
RSA_SSA_PSS_SHA384_MGF1
RSA with MGF1 with SHA-384 -
RSA_SSA_PSS_SHA512_MGF1
RSA with MGF1 with SHA-512 -
RSA_SSA_PSS_SHA3_224_MGF1
RSA with MGF1 with SHA3-224 -
RSA_SSA_PSS_SHA3_256_MGF1
RSA with MGF1 with SHA3-256 -
RSA_SSA_PSS_SHA3_384_MGF1
RSA with MGF1 with SHA3-384 -
RSA_SSA_PSS_SHA3_512_MGF1
RSA with MGF1 with SHA3-512 -
RSA_RIPEMD160
RSA with RIPEMD160 -
RSA_MD2
RSA with MD2 -
RSA_MD5
RSA with MD5 -
ECDSA_RAW
ECDSA without digest algorithm -
ECDSA_SHA1
ECDSA with SHA-1 -
ECDSA_SHA224
ECDSA with SHA-224 -
ECDSA_SHA256
ECDSA with SHA-256 -
ECDSA_SHA384
ECDSA with SHA-384 -
ECDSA_SHA512
ECDSA with SHA-512 -
ECDSA_SHA3_224
ECDSA with SHA3-224 -
ECDSA_SHA3_256
ECDSA with SHA3-256 -
ECDSA_SHA3_384
ECDSA with SHA3-384 -
ECDSA_SHA3_512
ECDSA with SHA3-512 -
ECDSA_RIPEMD160
ECDSA with RIPEMD160 -
PLAIN_ECDSA_SHA1
PLAIN-ECDSA with SHA-1 -
PLAIN_ECDSA_SHA224
PLAIN-ECDSA with SHA-224 -
PLAIN_ECDSA_SHA256
PLAIN-ECDSA with SHA-256 -
PLAIN_ECDSA_SHA384
PLAIN-ECDSA with SHA-384 -
PLAIN_ECDSA_SHA512
PLAIN-ECDSA with SHA-512 -
PLAIN_ECDSA_SHA3_224
PLAIN-ECDSA with SHA3-224 -
PLAIN_ECDSA_SHA3_256
PLAIN-ECDSA with SHA3-256 -
PLAIN_ECDSA_SHA3_384
PLAIN-ECDSA with SHA3-384 -
PLAIN_ECDSA_SHA3_512
PLAIN-ECDSA with SHA3-512 -
PLAIN_ECDSA_RIPEMD160
PLAIN-ECDSA with RIPEMD160 -
DSA_RAW
DSA without digest algorithm -
DSA_SHA1
DSA with SHA-1 -
DSA_SHA224
DSA with SHA-224 -
DSA_SHA256
DSA with SHA-256 -
DSA_SHA384
DSA with SHA-384 -
DSA_SHA512
DSA with SHA-512 -
DSA_SHA3_224
DSA with SHA3-224 -
DSA_SHA3_256
DSA with SHA3-256 -
DSA_SHA3_384
DSA with SHA3-384 -
DSA_SHA3_512
DSA with SHA3-512 -
HMAC_SHA1
HMAC with SHA-1 -
HMAC_SHA224
HMAC with SHA-224 -
HMAC_SHA256
HMAC with SHA-256 -
HMAC_SHA384
HMAC with SHA-384 -
HMAC_SHA512
HMAC with SHA-512 -
HMAC_SHA3_224
HMAC with SHA3-224 -
HMAC_SHA3_256
HMAC with SHA3-256 -
HMAC_SHA3_384
HMAC with SHA3-384 -
HMAC_SHA3_512
HMAC with SHA3-512 -
HMAC_RIPEMD160
HMAC with RIPEMD160 -
ED25519
EDDSA with SHA512 -
ED448
EDDSA with SHAKE256-512
-
-
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
-
forXML
Returns a correspondingSignatureAlgorithm
by the XML URI string- Parameters:
xmlName
-String
XML URI- Returns:
SignatureAlgorithm
-
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
Returns a correspondingSignatureAlgorithm
by the OID- Parameters:
oid
-String
- Returns:
SignatureAlgorithm
-
forOidAndParams
Returns a correspondingSignatureAlgorithm
by the OID and signature algorithm parameters- Parameters:
oid
-String
sigAlgParams
- a byte array of signature algorithm parameters- Returns:
SignatureAlgorithm
-
forJWA
Returns a correspondingSignatureAlgorithm
by the JWA name- Parameters:
jsonWebAlgorithm
-String
JWA algorithm Id- Returns:
SignatureAlgorithm
-
forJWA
This method return theSignatureAlgorithm
or the default value if the algorithm is unknown.- Parameters:
jsonWebAlgorithm
-String
JWA algorithm IddefaultValue
- the default value to be returned if not found- Returns:
SignatureAlgorithm
or default value
-
forJAVA
For given signature algorithm and digest algorithm this function returns the Java form of the signature algorithm Signature AlgorithmsThe 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
@Deprecated public static SignatureAlgorithm getAlgorithm(EncryptionAlgorithm encryptionAlgorithm, DigestAlgorithm digestAlgorithm, MaskGenerationFunction mgf) Deprecated.since DSS 6.1. Please use#getAlgorithm(encryptionAlgorithm, digestAlgorithm)
method instead. UseEncryptionAlgorithm.RSA
orEncryptionAlgorithm.RSASSA_PSS
to differentiate between MGF use.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
Deprecated.since DSS 6.1. Please use#getEncryptionAlgorithm
in order to differentiate between MGF values (use RSA for none MGF, RSASSA_PSS for MGF1)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.
-
getJWAId
Returns algorithm identifier corresponding to JWA accepted algorithms (RFC 7518)- Returns:
- the JWA algorithm identifier
-
getName
-