Package org.pgpainless.algorithm
Enum SymmetricKeyAlgorithm
- java.lang.Object
-
- java.lang.Enum<SymmetricKeyAlgorithm>
-
- org.pgpainless.algorithm.SymmetricKeyAlgorithm
-
- All Implemented Interfaces:
Serializable
,Comparable<SymmetricKeyAlgorithm>
public enum SymmetricKeyAlgorithm extends Enum<SymmetricKeyAlgorithm>
Enumeration of possible symmetric encryption algorithms.- See Also:
- RFC4880: Symmetric-Key Algorithms
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AES_128
AES with 128-bit key.AES_192
AES with 192-bit key.AES_256
AES with 256-bit key.BLOWFISH
Blowfish (128-bit key, 16 rounds).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.CAST5
CAST5 (128-bit key, as per RFC2144).DES
Reserved in RFC4880.IDEA
Deprecated.use a different algorithm.NULL
Plaintext or unencrypted data.SAFER
Reserved in RFC4880.TRIPLE_DES
TripleDES (DES-EDE - 168 bit key derived from 192).TWOFISH
Twofish with 256-bit key.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SymmetricKeyAlgorithm
fromId(int id)
Return theSymmetricKeyAlgorithm
enum that corresponds to the provided numeric id.int
getAlgorithmId()
Return the numeric algorithm id of the enum.static SymmetricKeyAlgorithm
valueOf(String name)
Returns the enum constant of this type with the specified name.static SymmetricKeyAlgorithm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NULL
public static final SymmetricKeyAlgorithm NULL
Plaintext or unencrypted data.
-
IDEA
@Deprecated public static final SymmetricKeyAlgorithm IDEA
Deprecated.use a different algorithm.IDEA is deprecated.
-
TRIPLE_DES
public static final SymmetricKeyAlgorithm TRIPLE_DES
TripleDES (DES-EDE - 168 bit key derived from 192).
-
CAST5
public static final SymmetricKeyAlgorithm CAST5
CAST5 (128-bit key, as per RFC2144).
-
BLOWFISH
public static final SymmetricKeyAlgorithm BLOWFISH
Blowfish (128-bit key, 16 rounds).
-
SAFER
public static final SymmetricKeyAlgorithm SAFER
Reserved in RFC4880. SAFER-SK128 (13 rounds)
-
DES
public static final SymmetricKeyAlgorithm DES
Reserved in RFC4880. Reserved for DES/SK
-
AES_128
public static final SymmetricKeyAlgorithm AES_128
AES with 128-bit key.
-
AES_192
public static final SymmetricKeyAlgorithm AES_192
AES with 192-bit key.
-
AES_256
public static final SymmetricKeyAlgorithm AES_256
AES with 256-bit key.
-
TWOFISH
public static final SymmetricKeyAlgorithm TWOFISH
Twofish with 256-bit key.
-
CAMELLIA_128
public static final SymmetricKeyAlgorithm CAMELLIA_128
Reserved for Camellia with 128-bit key.
-
CAMELLIA_192
public static final SymmetricKeyAlgorithm CAMELLIA_192
Reserved for Camellia with 192-bit key.
-
CAMELLIA_256
public static final SymmetricKeyAlgorithm CAMELLIA_256
Reserved for Camellia with 256-bit key.
-
-
Method Detail
-
values
public static SymmetricKeyAlgorithm[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SymmetricKeyAlgorithm c : SymmetricKeyAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SymmetricKeyAlgorithm 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
-
fromId
public static SymmetricKeyAlgorithm fromId(int id)
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
-
getAlgorithmId
public int getAlgorithmId()
Return the numeric algorithm id of the enum.- Returns:
- numeric id
-
-