Package org.pgpainless.algorithm
Enum Class SymmetricKeyAlgorithm
- All Implemented Interfaces:
Serializable
,Comparable<SymmetricKeyAlgorithm>
,Constable
Enumeration of possible symmetric encryption algorithms.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAES with 128-bit key.AES with 192-bit key.AES with 256-bit key.Blowfish (128-bit key, 16 rounds).Reserved for Camellia with 128-bit key.Reserved for Camellia with 192-bit key.Reserved for Camellia with 256-bit key.CAST5 (128-bit key, as per RFC2144).Reserved in RFC4880.Deprecated.use a different algorithm.Plaintext or unencrypted data.Reserved in RFC4880.TripleDES (DES-EDE - 168 bit key derived from 192).Twofish with 256-bit key. -
Method Summary
Modifier and TypeMethodDescriptionstatic SymmetricKeyAlgorithm
fromId
(int id) Return theSymmetricKeyAlgorithm
enum that corresponds to the provided numeric id.int
Return the numeric algorithm id of the enum.static SymmetricKeyAlgorithm
requireFromId
(int id) Return theSymmetricKeyAlgorithm
enum that corresponds to the provided numeric id.static SymmetricKeyAlgorithm
Returns the enum constant of this class with the specified name.static SymmetricKeyAlgorithm[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NULL
Plaintext or unencrypted data. -
IDEA
Deprecated.use a different algorithm.IDEA is deprecated. -
TRIPLE_DES
TripleDES (DES-EDE - 168 bit key derived from 192). -
CAST5
CAST5 (128-bit key, as per RFC2144). -
BLOWFISH
Blowfish (128-bit key, 16 rounds). -
SAFER
Reserved in RFC4880. SAFER-SK128 (13 rounds) -
DES
Reserved in RFC4880. Reserved for DES/SK -
AES_128
AES with 128-bit key. -
AES_192
AES with 192-bit key. -
AES_256
AES with 256-bit key. -
TWOFISH
Twofish with 256-bit key. -
CAMELLIA_128
Reserved for Camellia with 128-bit key. -
CAMELLIA_192
Reserved for Camellia with 192-bit key. -
CAMELLIA_256
Reserved for Camellia with 256-bit key.
-
-
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
-
fromId
Return theSymmetricKeyAlgorithm
enum that corresponds to the provided numeric id. If an invalid id is provided, null is returned.- Parameters:
id
- numeric algorithm id- Returns:
- symmetric key algorithm enum
-
requireFromId
Return theSymmetricKeyAlgorithm
enum that corresponds to the provided numeric id. If an invalid id is provided, throw aNoSuchElementException
.- Parameters:
id
- numeric algorithm id- Returns:
- symmetric key algorithm enum
- Throws:
NoSuchElementException
- if an unmatched id is provided
-
getAlgorithmId
public int getAlgorithmId()Return the numeric algorithm id of the enum.- Returns:
- numeric id
-