Package com.bld.crypto.bean
Class CryptoKeyUtils
- java.lang.Object
-
- com.bld.crypto.bean.CryptoKeyUtils
-
- Direct Known Subclasses:
CryptoAesUtils,CryptoJksUtils,CryptoPublicKeyUtils
public abstract class CryptoKeyUtils extends Object
The Class CryptoKeyUtils.
-
-
Constructor Summary
Constructors Constructor Description CryptoKeyUtils()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StringdecryptUri(String value, String key)Decrypt uri.protected abstract StringdecryptValue(String value, String key)Decrypt value.StringdecryptValue(String value, Key key)Decrypt value.protected StringencodeValue(String valueEncrypted)Encode value.protected StringencryptUri(String value, String key)Encrypt uri.protected abstract StringencryptValue(String value, String key)Encrypt value.StringencryptValue(String value, Key key)Encrypt value.protected CiphergetCipher(int mode, Key key)Gets the cipher.protected abstract InstanceTypeinstanceType()Instance type.
-
-
-
Field Detail
-
_252F
protected static final String _252F
The Constant _252F.- See Also:
- Constant Field Values
-
_2F
protected static final String _2F
The Constant _2F.- See Also:
- Constant Field Values
-
objMapper
@Autowired protected com.fasterxml.jackson.databind.ObjectMapper objMapper
The obj mapper.
-
-
Method Detail
-
instanceType
protected abstract InstanceType instanceType()
Instance type.- Returns:
- the instance type
-
getCipher
protected Cipher getCipher(int mode, Key key) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException
Gets the cipher.- Parameters:
mode- the modekey- the key- Returns:
- the cipher
- Throws:
NoSuchAlgorithmException- the no such algorithm exceptionNoSuchPaddingException- the no such padding exceptionInvalidKeyException- the invalid key exception
-
encryptValue
public String encryptValue(String value, Key key)
Encrypt value.- Parameters:
value- the valuekey- the key- Returns:
- the string
-
decryptValue
public String decryptValue(String value, Key key)
Decrypt value.- Parameters:
value- the valuekey- the key- Returns:
- the string
-
encryptValue
protected abstract String encryptValue(String value, String key)
Encrypt value.- Parameters:
value- the valuekey- the key- Returns:
- the string
-
decryptValue
protected abstract String decryptValue(String value, String key)
Decrypt value.- Parameters:
value- the valuekey- the key- Returns:
- the string
-
encryptUri
protected String encryptUri(String value, String key)
Encrypt uri.- Parameters:
value- the valuekey- the key- Returns:
- the string
-
encodeValue
protected String encodeValue(String valueEncrypted)
Encode value.- Parameters:
valueEncrypted- the value encrypted- Returns:
- the string
-
-