- java.lang.Object
-
- io.github.mmm.crypto.crypt.CipherTransformation
-
- All Implemented Interfaces:
CryptoAlgorithm
public class CipherTransformation extends Object implements CryptoAlgorithm
Simple representation of aCiphertransformation. Please be careful not to confuse or mixalgorithmandtransformation.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static StringMODE_GCMModevalue "GCM" (Galois/Counter Mode).static StringPADDING_NONEPaddingvalue "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 booleanequals(Object obj)StringgetAlgorithm()StringgetMode()StringgetPadding()StringgetTransformation()inthashCode()static CipherTransformationof(String transformation)StringtoString()
-
-
-
Field Detail
-
PADDING_NONE
public static final String PADDING_NONE
Paddingvalue "NoPadding".- See Also:
- Constant Field Values
-
MODE_GCM
public static final String MODE_GCM
Modevalue "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:
getAlgorithmin 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 modemode.
-
getPadding
public String getPadding()
- Returns:
- the
cipher paddingpadding.
-
getTransformation
public String getTransformation()
- Returns:
- the
cipher transformationcomposed ofalgorithm,mode, andpadding.
-
of
public static CipherTransformation of(String transformation)
- Parameters:
transformation- thetransformation.- Returns:
- the parsed
CipherTransformation.
-
-