Package com.unboundid.util
Enum PassphraseEncryptionCipherType
- java.lang.Object
-
- java.lang.Enum<PassphraseEncryptionCipherType>
-
- com.unboundid.util.PassphraseEncryptionCipherType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<PassphraseEncryptionCipherType>
@ThreadSafety(level=COMPLETELY_THREADSAFE) public enum PassphraseEncryptionCipherType extends java.lang.Enum<PassphraseEncryptionCipherType>
This enum defines sets of settings that may be used when encrypting data with aPassphraseEncryptedOutputStream
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PassphraseEncryptionCipherType
forName(java.lang.String name)
Retrieves the cipher type value for the provided name.java.lang.String
getCipherTransformation()
Retrieves the cipher transformation that will be used for the encryption.int
getInitializationVectorLengthBytes()
Retrieves the length (in bytes) to use for the initialization vector when generating the cipher.java.lang.String
getKeyFactoryAlgorithm()
Retrieves the name of the algorithm that will be used to generate the encryption key from the passphrase.int
getKeyFactoryIterationCount()
Retrieves the iteration count that will be used when generating the encryption key from the passphrase.int
getKeyFactorySaltLengthBytes()
Retrieves the length (in bytes) to use for the salt when generating the encryption key from the passphrase.int
getKeyLengthBits()
Retrieves the length (in bits) for the encryption key to generate.java.lang.String
getMacAlgorithm()
Retrieves the name of the algorithm that will be used to generate a MAC of the encryption header contents.static PassphraseEncryptionCipherType
getStrongestAvailableCipherType()
Retrieves the cipher type value that corresponds to the strongest supported level of protection that is available in the underlying JVM.java.lang.String
toString()
Retrieves a string representation of this cipher type value.void
toString(java.lang.StringBuilder buffer)
Appends a string representation of this cipher type value to the provided buffer.static PassphraseEncryptionCipherType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static PassphraseEncryptionCipherType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
AES_128
public static final PassphraseEncryptionCipherType AES_128
Cipher settings that use a 128-bit AES cipher.
-
AES_256
public static final PassphraseEncryptionCipherType AES_256
Cipher settings that use a 256-bit AES cipher.
-
-
Method Detail
-
values
public static PassphraseEncryptionCipherType[] 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 (PassphraseEncryptionCipherType c : PassphraseEncryptionCipherType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PassphraseEncryptionCipherType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getCipherTransformation
@NotNull public java.lang.String getCipherTransformation()
Retrieves the cipher transformation that will be used for the encryption.- Returns:
- The cipher transformation that will be used for the encryption.
-
getKeyLengthBits
public int getKeyLengthBits()
Retrieves the length (in bits) for the encryption key to generate.- Returns:
- The length (in bits) for the encryption key to generate.
-
getKeyFactoryAlgorithm
@NotNull public java.lang.String getKeyFactoryAlgorithm()
Retrieves the name of the algorithm that will be used to generate the encryption key from the passphrase.- Returns:
- The name of the algorithm that will be used to generate the encryption key from the passphrase.
-
getKeyFactoryIterationCount
public int getKeyFactoryIterationCount()
Retrieves the iteration count that will be used when generating the encryption key from the passphrase.- Returns:
- The iteration count that will be used when generating the encryption key from the passphrase.
-
getKeyFactorySaltLengthBytes
public int getKeyFactorySaltLengthBytes()
Retrieves the length (in bytes) to use for the salt when generating the encryption key from the passphrase.- Returns:
- The length (in bytes) to use for the salt when generating the encryption key from the passphrase.
-
getInitializationVectorLengthBytes
public int getInitializationVectorLengthBytes()
Retrieves the length (in bytes) to use for the initialization vector when generating the cipher.- Returns:
- The length (in bytes) to use for the initialization vector when generating the cipher.
-
getMacAlgorithm
@NotNull public java.lang.String getMacAlgorithm()
Retrieves the name of the algorithm that will be used to generate a MAC of the encryption header contents.- Returns:
- The name of the algorithm that will be used to generate a MAC of the encryption header contents.
-
forName
@Nullable public static PassphraseEncryptionCipherType forName(@NotNull java.lang.String name)
Retrieves the cipher type value for the provided name.- Parameters:
name
- The name of the cipher type value to retrieve.- Returns:
- The cipher type object for the given name, or
null
if the provided name does not map to any cipher type value.
-
getStrongestAvailableCipherType
@NotNull public static PassphraseEncryptionCipherType getStrongestAvailableCipherType()
Retrieves the cipher type value that corresponds to the strongest supported level of protection that is available in the underlying JVM.- Returns:
- The cipher type value that corresponds to the strongest supported level of protection in the underlying JVM.
-
toString
@NotNull public java.lang.String toString()
Retrieves a string representation of this cipher type value.- Overrides:
toString
in classjava.lang.Enum<PassphraseEncryptionCipherType>
- Returns:
- A string representation of this cipher type value.
-
-