Package org.apache.commons.crypto.utils
Class Transformation
- java.lang.Object
-
- org.apache.commons.crypto.utils.Transformation
-
public class Transformation extends java.lang.Object
Transformation algorithm, mode and padding, in the format "Algorithm/Mode/Padding", for example "AES/CBC/NoPadding".- Since:
- 1.2.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
algorithm
private java.lang.String
mode
private Padding
padding
private static int
T_DELIM_PARTS
private static java.lang.String
T_DELIM_REGEX
-
Constructor Summary
Constructors Modifier Constructor Description private
Transformation(java.lang.String algorithm, java.lang.String mode, java.lang.String padding)
Constructs a new instance.private
Transformation(java.lang.String algorithm, java.lang.String mode, Padding padding)
Constructs a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAlgorithm()
Gets the algorithm.java.lang.String
getMode()
Gets the mode.Padding
getPadding()
Gets the padding.static Transformation
parse(java.lang.String transformation)
Parses a transformation.
-
-
-
Field Detail
-
T_DELIM_PARTS
private static final int T_DELIM_PARTS
- See Also:
- Constant Field Values
-
T_DELIM_REGEX
private static final java.lang.String T_DELIM_REGEX
- See Also:
- Constant Field Values
-
algorithm
private final java.lang.String algorithm
-
mode
private final java.lang.String mode
-
padding
private final Padding padding
-
-
Constructor Detail
-
Transformation
private Transformation(java.lang.String algorithm, java.lang.String mode, Padding padding)
Constructs a new instance.- Parameters:
algorithm
- the algorithm namemode
- the mode namepadding
- the padding name
-
Transformation
private Transformation(java.lang.String algorithm, java.lang.String mode, java.lang.String padding) throws javax.crypto.NoSuchPaddingException
Constructs a new instance.- Parameters:
algorithm
- the algorithm namemode
- the mode namepadding
- the padding name- Throws:
javax.crypto.NoSuchPaddingException
- Thrown when the padding is unsupported.
-
-
Method Detail
-
parse
public static Transformation parse(java.lang.String transformation) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException
Parses a transformation.- Parameters:
transformation
- current transformation- Returns:
- the Transformation
- Throws:
java.security.NoSuchAlgorithmException
- if the algorithm is not supportedjavax.crypto.NoSuchPaddingException
- Thrown when the padding is unsupported.
-
getAlgorithm
public java.lang.String getAlgorithm()
Gets the algorithm.- Returns:
- the algorithm.
-
getMode
public java.lang.String getMode()
Gets the mode.- Returns:
- the mode.
-
getPadding
public Padding getPadding()
Gets the padding.- Returns:
- the padding.
-
-