Package org.pgpainless.algorithm

# Enum Class SymmetricKeyAlgorithm

java.lang.Object
java.lang.Enum<SymmetricKeyAlgorithm>
org.pgpainless.algorithm.SymmetricKeyAlgorithm

All Implemented Interfaces:
  `Serializable`, `Comparable<SymmetricKeyAlgorithm>`, `Constable`

public enum SymmetricKeyAlgorithm extends Enum<SymmetricKeyAlgorithm>
Enumeration of possible symmetric encryption algorithms.

See Also:
  - RFC4880: Symmetric-Key Algorithms

## Nested Class Summary

## Nested classes/interfaces inherited from class java.lang.Enum

`Enum.EnumDesc<E extends Enum<E>>`

## 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

Modifier and Type
Method
Description
`static SymmetricKeyAlgorithm`
`fromId(int id)`
Return the `SymmetricKeyAlgorithm` enum that corresponds to the provided numeric id.
`int`
`getAlgorithmId()`
Return the numeric algorithm id of the enum.
`static SymmetricKeyAlgorithm`
`requireFromId(int id)`
Return the `SymmetricKeyAlgorithm` enum that corresponds to the provided numeric id.
`static SymmetricKeyAlgorithm`
`valueOf(String name)`
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.

### Methods inherited from class java.lang.Enum

`clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

## Enum Constant Details

### 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 Details

### values

public static SymmetricKeyAlgorithm[] 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

public static SymmetricKeyAlgorithm valueOf(String name)
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 name
  `NullPointerException` - if the argument is null

### fromId

@Nullable public static SymmetricKeyAlgorithm fromId(int id)
Return the `SymmetricKeyAlgorithm` 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

@Nonnull public static SymmetricKeyAlgorithm requireFromId(int id)
Return the `SymmetricKeyAlgorithm` enum that corresponds to the provided numeric id. If an invalid id is provided, throw a `NoSuchElementException`.

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