Package ddf.security.encryption.impl
Class EncryptionServiceImpl
java.lang.Object
ddf.security.encryption.impl.EncryptionServiceImpl
- All Implemented Interfaces:
ddf.security.encryption.EncryptionService,org.apache.wss4j.common.crypto.PasswordEncryptor
public class EncryptionServiceImpl
extends Object
implements ddf.security.encryption.EncryptionService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDecrypts a plain text value.decryptValue(String wrappedEncryptedValue) Encrypts a plain text value.encryptValue(String unwrappedPlaintext) unwrapEncryptedValue(String wrappedEncryptedValue)
-
Constructor Details
-
EncryptionServiceImpl
public EncryptionServiceImpl()
-
-
Method Details
-
encrypt
Encrypts a plain text value. Returns no-op in the case of a problem.- Specified by:
encryptin interfaceorg.apache.wss4j.common.crypto.PasswordEncryptor- Parameters:
plainTextValue- The value to encrypt.
-
decrypt
Decrypts a plain text value. Returns no-op in the case of a problem.- Specified by:
decryptin interfaceorg.apache.wss4j.common.crypto.PasswordEncryptor- Parameters:
encryptedValue- The value to decrypt.
-
encryptValue
One can encrypt passwords using the security:encrypt console command. user@local>security:encrypt secret c+GitDfYAMTDRESXSDDsMw== A wrapped encrypted password is wrapped in ENC() as follows: ENC(HsOcGt8seSKc34sRUYpakQ==)- Specified by:
encryptValuein interfaceddf.security.encryption.EncryptionService
-
decryptValue
- Specified by:
decryptValuein interfaceddf.security.encryption.EncryptionService
-
unwrapEncryptedValue
Given a string that starts with 'ENC(' and ends with ')', returns the in-between substring. This method is meant to remove the wrapping notation for encrypted values, typically passwords.
If the input is a password and is not in the form ENC(my-encrypted-password), we assume the password is not encrypted. Returns a no-op in the case of a problem.
- Specified by:
unwrapEncryptedValuein interfaceddf.security.encryption.EncryptionService- Parameters:
wrappedEncryptedValue- The wrapped encrypted value, in the form 'ENC(my-encrypted-value)'.- Returns:
- The value within the parenthesis.
-