Package com.saperion.common.crypto
Enum Class CipherStrategy
- All Implemented Interfaces:
Serializable
,Comparable<CipherStrategy>
,Constable
CipherStrategy
enumerates the few strategies for a Cipher
used by SAPERION.
It defines the encryption algorithm, block mode, padding type and key size to use.
If a new strategy is really needed, a new entry must be made and a new corresponding Cipher
-implementation
must be provided.
- Author:
- agz
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the encryption algorithm of thisCipherStrategy
.int
Returns the key size (number of bits) of thisCipherStrategy
.getMode()
Returns the name of the mode of thisCipherStrategy
.Returns the name of the padding of thisCipherStrategy
.static CipherStrategy
Returns the enum constant of this class with the specified name.static CipherStrategy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AES_128
Algorithm = "AES" Mode = "CBC" Padding = "PKCS5Padding" KeySize = 128 -
RSA_2048
Algorithm = "RSA" Mode = "ECB" Padding = "PKCS1Padding" KeySize = 2048
-
-
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
-
getAlgorithm
Returns the name of the encryption algorithm of thisCipherStrategy
.- Returns:
- the encryption algorithm
-
getMode
Returns the name of the mode of thisCipherStrategy
.- Returns:
- the mode
-
getPadding
Returns the name of the padding of thisCipherStrategy
.- Returns:
- the padding
-
getKeySize
public int getKeySize()Returns the key size (number of bits) of thisCipherStrategy
.- Returns:
- the key size
-