Enum Class Padding
- All Implemented Interfaces:
Serializable,Comparable<Padding>,Constable
Enumeration listing all available padding types for encryption.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Padding[]Get applicable padding sets for a given Algorithm type.static PaddinggetById(int id) Get a padding by its ASN.1 ID.static PaddinggetByString(String name) Get a padding by its name.static PaddingGet the default padding for a given AlgorithmType.intgetId()Get the numeric ASN.1 id of the padding.intgetMaxSize(int blockSize) Gets the maximum payload size.org.bouncycastle.asn1.ASN1EnumeratedtoAsn1()Get the corresponding ASN1 enumeration.toString()Get the textual representation of the padding for the cryptographic provider.static PaddingReturns the enum constant of this class with the specified name.static Padding[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
-
PKCS1
-
OAEP_SHA256_MGF1
-
OAEP_SHA384_MGF1
-
OAEP_SHA512_MGF1
-
PKCS7
-
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
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
-
getAlgorithms
Get applicable padding sets for a given Algorithm type.
- Parameters:
at- the type of algorithm- Returns:
- an array of supported paddings
-
getById
Get a padding by its ASN.1 ID.
- Parameters:
id- the ASN.1 numericcal ID- Returns:
- the padding or null if ID is unknown
-
getByString
Get a padding by its name.
- Parameters:
name- the name used by the cryptographic provider- Returns:
- the padding or null if name is unknown
-
getDefault
Get the default padding for a given AlgorithmType.
- Parameters:
at- the algorithm type- Returns:
- the default padding for the given algorithm type
-
getId
public int getId()Get the numeric ASN.1 id of the padding.
- Returns:
- the id of the padding
-
toString
Get the textual representation of the padding for the cryptographic provider.
-
getMaxSize
public int getMaxSize(int blockSize) Gets the maximum payload size.
The payload size is calculated by <block size>-<padding overhead>.
- Parameters:
blockSize- the block size of the cryptographic algorithm (usually equals the key size)- Returns:
- the number of bytes a single block may hold including the padding information.
-
toAsn1
public org.bouncycastle.asn1.ASN1Enumerated toAsn1()Get the corresponding ASN1 enumeration.
- Returns:
- the ASN1 enumeration representing this padding
-