Class CasConfigurationJasyptCipherExecutor
java.lang.Object
org.apereo.cas.configuration.support.CasConfigurationJasyptCipherExecutor
- All Implemented Interfaces:
org.apereo.cas.util.crypto.CipherExecutor<String,
,String> org.apereo.cas.util.crypto.DecodableCipher<String,
,String> org.apereo.cas.util.crypto.EncodableCipher<String,
String>
public class CasConfigurationJasyptCipherExecutor
extends Object
implements org.apereo.cas.util.crypto.CipherExecutor<String,String>
This is
CasConfigurationJasyptCipherExecutor
.- Since:
- 5.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The Jasypt encryption parameters. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Prefix inserted at the beginning of a value to indicate it's encrypted.Fields inherited from interface org.apereo.cas.util.crypto.CipherExecutor
DEFAULT_CONTENT_ENCRYPTION_ALGORITHM, DEFAULT_STRINGABLE_ENCRYPTION_KEY_SIZE, DEFAULT_STRINGABLE_SIGNING_KEY_SIZE
Fields inherited from interface org.apereo.cas.util.crypto.DecodableCipher
LOGGER
-
Constructor Summary
ConstructorsConstructorDescriptionCasConfigurationJasyptCipherExecutor
(String algorithm, String password) CasConfigurationJasyptCipherExecutor
(org.springframework.core.env.Environment environment) -
Method Summary
Modifier and TypeMethodDescriptiondecryptValue
(String value) Decrypt value string.encryptValue
(String value) Encrypt value as string.encryptValue
(String value, Function<Exception, String> handler) Encrypt value string.static String
extractEncryptedValue
(String value) Extract encrypted value as string to decode later.getName()
static boolean
isValueEncrypted
(String value) Is value encrypted, and does it start with the required prefix.void
setAlgorithm
(String alg) Sets algorithm.void
setIvGenerator
(org.jasypt.iv.IvGenerator iv) Sets iv generator.void
Sets key obtention iterations.void
setPassword
(String psw) Sets password.void
setProviderName
(String pName) Sets provider name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apereo.cas.util.crypto.CipherExecutor
getSigningKey, isEnabled
Methods inherited from interface org.apereo.cas.util.crypto.DecodableCipher
decode, decode
Methods inherited from interface org.apereo.cas.util.crypto.EncodableCipher
encode
-
Field Details
-
ENCRYPTED_VALUE_PREFIX
Prefix inserted at the beginning of a value to indicate it's encrypted.- See Also:
-
-
Constructor Details
-
CasConfigurationJasyptCipherExecutor
-
CasConfigurationJasyptCipherExecutor
public CasConfigurationJasyptCipherExecutor(org.springframework.core.env.Environment environment)
-
-
Method Details
-
setAlgorithm
Sets algorithm.- Parameters:
alg
- the alg
-
setIvGenerator
public void setIvGenerator(org.jasypt.iv.IvGenerator iv) Sets iv generator.- Parameters:
iv
- the iv
-
setPassword
Sets password.- Parameters:
psw
- the psw
-
setKeyObtentionIterations
Sets key obtention iterations.- Parameters:
iter
- the iter
-
setProviderName
Sets provider name.- Parameters:
pName
- the p name
-
encode
-
decode
-
getName
-
encryptValue
Encrypt value string.- Parameters:
value
- the valuehandler
- the handler- Returns:
- the string
-
encryptValue
Encrypt value as string.- Parameters:
value
- the value- Returns:
- the string
-
decryptValue
Decrypt value string.- Parameters:
value
- the value- Returns:
- the string
-
isValueEncrypted
Is value encrypted, and does it start with the required prefix.- Parameters:
value
- the value- Returns:
- true/false
-
extractEncryptedValue
Extract encrypted value as string to decode later.- Parameters:
value
- the value- Returns:
- the string
-