Enum Class Mode
- All Implemented Interfaces:
Serializable,Comparable<Mode>,Constable
Enumeration to list available encryption modes.
-
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 TypeMethodDescriptionstatic ModegetById(int id) Get enumeration element by its ASN.1 ID.static ModegetByString(String name) Get enumeration element by its name.static ModegetDefault(AlgorithmType type) Gets the currently set default value for the given type.intgetId()Gets the ASN.1 numerical ID.static Mode[]Gets all cipher modes suitable for the specified algorithm.Padding[]Gets all known paddings regardless of their support.booleanorg.bouncycastle.asn1.ASN1EnumeratedtoAsn1()Gets the corresponding ASN1 enumeration.toString()Gets the mode identifier as required by the encryption provider.static ModeReturns the enum constant of this class with the specified name.static Mode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ECB
-
CBC
-
EAX
-
CTR
-
CCM
-
GCM
-
OCB
-
OFB
-
NONE
-
-
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
-
getRequiresInitVector
public boolean getRequiresInitVector() -
getById
Get enumeration element by its ASN.1 ID.- Parameters:
id- the ID of the element to be obtained- Returns:
- the element or null if the ID is unknown
-
getByString
Get enumeration element by its name.
- Parameters:
name- the name of the element to be obtained- Returns:
- the element or null if the name is unknown
-
getDefault
Gets the currently set default value for the given type.
- Parameters:
type- the type for which the default value is required- Returns:
- the default value requested
-
getId
public int getId()Gets the ASN.1 numerical ID.
- Returns:
- the numerical ID
-
toString
Gets the mode identifier as required by the encryption provider.
This value is returned regardless of the support of the provider classes.
-
getPaddings
Gets all known paddings regardless of their support.
- Returns:
- an array of all paddings
-
getModes
Gets all cipher modes suitable for the specified algorithm.
- Parameters:
alg- the algorithm to be supported- Returns:
- an array of modes supported
-
toAsn1
public org.bouncycastle.asn1.ASN1Enumerated toAsn1()Gets the corresponding ASN1 enumeration.
- Returns:
- the corresponding ASN1 enumeration
-