Package org.apache.commons.crypto.utils
Class Transformation
java.lang.Object
org.apache.commons.crypto.utils.Transformation
Transformation algorithm, mode and padding, in the format "Algorithm/Mode/Padding", for example "AES/CBC/NoPadding".
- Since:
- 1.2.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Transformation
(String algorithm, String mode, String padding) Constructs a new instance.private
Transformation
(String algorithm, String mode, Padding padding) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the algorithm.getMode()
Gets the mode.Gets the padding.static Transformation
Parses a transformation.
-
Field Details
-
T_DELIM_PARTS
private static final int T_DELIM_PARTS- See Also:
-
T_DELIM_REGEX
- See Also:
-
algorithm
-
mode
-
padding
-
-
Constructor Details
-
Transformation
Constructs a new instance.- Parameters:
algorithm
- the algorithm namemode
- the mode namepadding
- the padding name
-
Transformation
Constructs a new instance.- Parameters:
algorithm
- the algorithm namemode
- the mode namepadding
- the padding name- Throws:
NoSuchPaddingException
- Thrown when the padding is unsupported.
-
-
Method Details
-
parse
public static Transformation parse(String transformation) throws NoSuchAlgorithmException, NoSuchPaddingException Parses a transformation.- Parameters:
transformation
- current transformation- Returns:
- the Transformation
- Throws:
NoSuchAlgorithmException
- if the algorithm is not supportedNoSuchPaddingException
- Thrown when the padding is unsupported.
-
getAlgorithm
Gets the algorithm.- Returns:
- the algorithm.
-
getMode
Gets the mode.- Returns:
- the mode.
-
getPadding
Gets the padding.- Returns:
- the padding.
-