Package eu.europa.esig.dss.enumerations
Enum EncryptionAlgorithm
- java.lang.Object
-
- java.lang.Enum<EncryptionAlgorithm>
-
- eu.europa.esig.dss.enumerations.EncryptionAlgorithm
-
- All Implemented Interfaces:
OidBasedEnum,Serializable,Comparable<EncryptionAlgorithm>
public enum EncryptionAlgorithm extends Enum<EncryptionAlgorithm> implements OidBasedEnum
Supported signature encryption algorithms.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DSAECDSAHMACPLAIN_ECDSARSA
-
Method Summary
Modifier and Type Method Description static EncryptionAlgorithmforKey(Key key)Returns the encryption algorithm associated to the given key.static EncryptionAlgorithmforName(String name)Returns the encryption algorithm associated to the given JCE name.static EncryptionAlgorithmforName(String name, EncryptionAlgorithm defaultValue)Returns the encryption algorithm associated to the given JCE name.static EncryptionAlgorithmforOID(String oid)Returns the encryption algorithm associated to the given OID.StringgetName()Get the algorithm nameStringgetOid()Get the ASN1 algorithm OIDStringgetPadding()Get the algorithm paddingstatic EncryptionAlgorithmvalueOf(String name)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 Detail
-
RSA
public static final EncryptionAlgorithm RSA
-
DSA
public static final EncryptionAlgorithm DSA
-
ECDSA
public static final EncryptionAlgorithm ECDSA
-
PLAIN_ECDSA
public static final EncryptionAlgorithm PLAIN_ECDSA
-
HMAC
public static final EncryptionAlgorithm HMAC
-
-
Method Detail
-
values
public static EncryptionAlgorithm[] 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 EncryptionAlgorithm 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
-
forOID
public static EncryptionAlgorithm forOID(String oid)
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
public static EncryptionAlgorithm forKey(Key key)
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
public static EncryptionAlgorithm forName(String name)
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
public static EncryptionAlgorithm forName(String name, EncryptionAlgorithm defaultValue)
Returns the encryption algorithm associated to the given JCE name.- Parameters:
name- the encryption algorithm namedefaultValue- The default value for theEncryptionAlgorithm- Returns:
- the corresponding
EncryptionAlgorithmor the default value
-
getName
public String getName()
Get the algorithm name- Returns:
- the name
-
getOid
public String getOid()
Get the ASN1 algorithm OID- Specified by:
getOidin interfaceOidBasedEnum- Returns:
- the OID
-
getPadding
public String getPadding()
Get the algorithm padding- Returns:
- the padding
-
-