public enum Mode extends Enum<Mode>
Enum Constant and Description |
---|
CBC |
CCM |
CTR |
EAX |
ECB |
GCM |
NONE |
OCB |
OFB |
Modifier and Type | Method and Description |
---|---|
static Mode |
getById(int id)
Get enumeration element by its ASN.1 ID.
|
static Mode |
getByString(String name)
Get enumeration element by its name.
|
static Mode |
getDefault(AlgorithmType type)
Gets the currently set default value for the given type.
|
int |
getId()
Gets the ASN.1 numerical ID.
|
static Mode[] |
getModes(Algorithm alg)
Gets all cipher modes suitable for the specified algorithm.
|
Padding[] |
getPaddings()
Gets all known paddings regardless of their support.
|
boolean |
getRequiresInitVector() |
org.bouncycastle.asn1.ASN1Enumerated |
toAsn1()
Gets the corresponding ASN1 enumeration.
|
String |
toString()
Gets the mode identifier as required by the encryption provider.
|
static Mode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Mode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Mode ECB
public static final Mode CBC
public static final Mode EAX
public static final Mode CTR
public static final Mode CCM
public static final Mode GCM
public static final Mode OCB
public static final Mode OFB
public static final Mode NONE
public static Mode[] values()
for (Mode c : Mode.values()) System.out.println(c);
public static Mode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean getRequiresInitVector()
public static Mode getById(int id)
id
- the ID of the element to be obtainedpublic static Mode getByString(String name)
Get enumeration element by its name.
name
- the name of the element to be obtainedpublic static Mode getDefault(AlgorithmType type)
Gets the currently set default value for the given type.
type
- the type for which the default value is requiredpublic int getId()
Gets the ASN.1 numerical ID.
public String toString()
Gets the mode identifier as required by the encryption provider.
This value is returned regardless of the support of the provider classes.
public Padding[] getPaddings()
Gets all known paddings regardless of their support.
public static Mode[] getModes(Algorithm alg)
Gets all cipher modes suitable for the specified algorithm.
alg
- the algorithm to be supportedpublic org.bouncycastle.asn1.ASN1Enumerated toAsn1()
Gets the corresponding ASN1 enumeration.
Copyright © 2023. All rights reserved.