Package eu.europa.esig.dss.enumerations
Enum EncryptionAlgorithm
- All Implemented Interfaces:
OidBasedEnum
,Serializable
,Comparable<EncryptionAlgorithm>
Supported signature encryption algorithms.
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic EncryptionAlgorithm
Returns the encryption algorithm associated to the given key.static EncryptionAlgorithm
Returns the encryption algorithm associated to the given JCE name.static EncryptionAlgorithm
forName
(String name, EncryptionAlgorithm defaultValue) Returns the encryption algorithm associated to the given JCE name.static EncryptionAlgorithm
Returns the encryption algorithm associated to the given OID.getName()
Get the algorithm namegetOid()
Get the ASN1 algorithm OIDGet the algorithm paddingboolean
isEquivalent
(EncryptionAlgorithm encryptionAlgorithm) Verifies if the providedencryptionAlgorithm
is equivalent to the current one.static EncryptionAlgorithm
Returns the enum constant of this type with the specified name.static EncryptionAlgorithm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
RSA
RSA -
DSA
DSA -
ECDSA
ECDSA -
PLAIN_ECDSA
PLAIN-ECDSA -
X25519
X25519 -
X448
X448 -
EDDSA
EdDSA -
HMAC
HMAC
-
-
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
-
forOID
Returns the encryption algorithm associated to the given OID.- Parameters:
oid
- the ASN1 algorithm OID- Returns:
- the linked encryption algorithm
- Throws:
IllegalArgumentException
- if the oid doesn't match any algorithm
-
forKey
Returns the encryption algorithm associated to the given key.- Parameters:
key
- the key- Returns:
- the linked encryption algorithm
- Throws:
IllegalArgumentException
- if the key doesn't match any algorithm
-
forName
Returns the encryption algorithm associated to the given JCE name.- Parameters:
name
- the encryption algorithm name- Returns:
- the linked encryption algorithm
- Throws:
IllegalArgumentException
- if the name doesn't match any algorithm
-
forName
Returns the encryption algorithm associated to the given JCE name.- Parameters:
name
- the encryption algorithm namedefaultValue
- The default value for theEncryptionAlgorithm
- Returns:
- the corresponding
EncryptionAlgorithm
or the default value
-
getName
Get the algorithm name- Returns:
- the name
-
getOid
Get the ASN1 algorithm OID- Specified by:
getOid
in interfaceOidBasedEnum
- Returns:
- the OID
-
getPadding
Get the algorithm padding- Returns:
- the padding
-
isEquivalent
Verifies if the providedencryptionAlgorithm
is equivalent to the current one. Equivalent means the same token key can be used for signature creation with both algorithms.- Parameters:
encryptionAlgorithm
-EncryptionAlgorithm
to check- Returns:
- TRUE if the algorithms are equivalent, FALSE otherwise
-