public enum Padding extends Enum<Padding> implements Serializable
Enumeration listing all available padding types for encryption.
Enum Constant and Description |
---|
NONE |
OAEP_SHA256_MGF1 |
OAEP_SHA384_MGF1 |
OAEP_SHA512_MGF1 |
PKCS1 |
PKCS7 |
Modifier and Type | Field and Description |
---|---|
static long |
serialVersionUID |
Modifier and Type | Method and Description |
---|---|
static Padding[] |
getAlgorithms(AlgorithmType at)
Get applicable padding sets for a given Algorithm type.
|
static Padding |
getById(int id)
Get a padding by its ASN.1 ID.
|
static Padding |
getByString(String name)
Get a padding by its name.
|
static Padding |
getDefault(AlgorithmType at)
Get the default padding for a given AlgorithmType.
|
int |
getId()
Get the numeric ASN.1 id of the padding.
|
int |
getMaxSize(int blockSize)
Gets the maximum payload size.
|
org.bouncycastle.asn1.ASN1Enumerated |
toAsn1()
Get the corresponding ASN1 enumeration.
|
String |
toString()
Get the textual representation of the padding for the cryptographic provider.
|
static Padding |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Padding[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Padding NONE
public static final Padding PKCS1
public static final Padding OAEP_SHA256_MGF1
public static final Padding OAEP_SHA384_MGF1
public static final Padding OAEP_SHA512_MGF1
public static final Padding PKCS7
public static final long serialVersionUID
public static Padding[] values()
for (Padding c : Padding.values()) System.out.println(c);
public static Padding 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 static Padding[] getAlgorithms(AlgorithmType at)
Get applicable padding sets for a given Algorithm type.
at
- the type of algorithmpublic static Padding getById(int id)
Get a padding by its ASN.1 ID.
id
- the ASN.1 numericcal IDpublic static Padding getByString(String name)
Get a padding by its name.
name
- the name used by the cryptographic providerpublic static Padding getDefault(AlgorithmType at)
Get the default padding for a given AlgorithmType.
at
- the algorithm typepublic int getId()
Get the numeric ASN.1 id of the padding.
public String toString()
Get the textual representation of the padding for the cryptographic provider.
public int getMaxSize(int blockSize)
Gets the maximum payload size.
The payload size is calculated by <block size>-<padding overhead>.
blockSize
- the block size of the cryptographic algorithm (usually equals the key size)public org.bouncycastle.asn1.ASN1Enumerated toAsn1()
Get the corresponding ASN1 enumeration.
Copyright © 2023. All rights reserved.