Package com.bld.crypto.bean
Class CryptoKeyUtils
java.lang.Object
com.bld.crypto.bean.CryptoKeyUtils
- Direct Known Subclasses:
CryptoAesUtils,CryptoJksUtils,CryptoPublicKeyUtils
The Class CryptoKeyUtils.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringdecryptUri(String value, String key) Decrypt uri.protected abstract StringdecryptValue(String value, String key) Decrypt value.decryptValue(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.encryptValue(String value, Key key) Encrypt value.protected CipherGets the cipher.protected abstract InstanceTypeInstance type.
-
Field Details
-
_252F
The Constant _252F.- See Also:
-
_2F
The Constant _2F.- See Also:
-
objMapper
@Autowired protected com.fasterxml.jackson.databind.ObjectMapper objMapperThe obj mapper.
-
-
Constructor Details
-
CryptoKeyUtils
public CryptoKeyUtils()
-
-
Method Details
-
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
Encrypt value.- Parameters:
value- the valuekey- the key- Returns:
- the string
-
decryptValue
Decrypt value.- Parameters:
value- the valuekey- the key- Returns:
- the string
-
encryptValue
Encrypt value.- Parameters:
value- the valuekey- the key- Returns:
- the string
-
decryptValue
Decrypt value.- Parameters:
value- the valuekey- the key- Returns:
- the string
-
encryptUri
Encrypt uri.- Parameters:
value- the valuekey- the key- Returns:
- the string
-
encodeValue
Encode value.- Parameters:
valueEncrypted- the value encrypted- Returns:
- the string
-
decryptUri
Decrypt uri.- Parameters:
value- the valuekey- the key- Returns:
- the string
-