- java.lang.Object
-
- io.github.mmm.crypto.crypt.CipherTransformation
-
- All Implemented Interfaces:
CryptoAlgorithm
public class CipherTransformation extends Object implements CryptoAlgorithm
Simple representation of aCipher
transformation
. Please be careful not to confuse or mixalgorithm
andtransformation
.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
MODE_GCM
Mode
value "GCM" (Galois/Counter Mode).static String
PADDING_NONE
Padding
value "NoPadding".
-
Constructor Summary
Constructors Constructor Description CipherTransformation(String algorithm)
The constructor.CipherTransformation(String algorithm, String mode, String padding)
The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getAlgorithm()
String
getMode()
String
getPadding()
String
getTransformation()
int
hashCode()
static CipherTransformation
of(String transformation)
String
toString()
-
-
-
Field Detail
-
PADDING_NONE
public static final String PADDING_NONE
Padding
value "NoPadding".- See Also:
- Constant Field Values
-
MODE_GCM
public static final String MODE_GCM
Mode
value "GCM" (Galois/Counter Mode).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CipherTransformation
public CipherTransformation(String algorithm)
The constructor. Be careful not to confuse withof(String)
to create from transformation.- Parameters:
algorithm
- - seegetAlgorithm()
.
-
CipherTransformation
public CipherTransformation(String algorithm, String mode, String padding)
The constructor.- Parameters:
algorithm
- - seegetAlgorithm()
.mode
- - seegetMode()
.padding
- - seegetPadding()
.
-
-
Method Detail
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithm
in interfaceCryptoAlgorithm
- Returns:
- the
encryption algorithm
. See Cipher Algorithm Names. - See Also:
Key.getAlgorithm()
,Signature.getAlgorithm()
,MessageDigest.getAlgorithm()
,SecureRandom.getAlgorithm()
,Cipher.getAlgorithm()
-
getMode
public String getMode()
- Returns:
- the
cipher mode
mode.
-
getPadding
public String getPadding()
- Returns:
- the
cipher padding
padding.
-
getTransformation
public String getTransformation()
- Returns:
- the
cipher transformation
composed ofalgorithm
,mode
, andpadding
.
-
of
public static CipherTransformation of(String transformation)
- Parameters:
transformation
- thetransformation
.- Returns:
- the parsed
CipherTransformation
.
-
-