use of password.pwm.util.secure.PwmBlockAlgorithm in project pwm by pwm-project.
the class AbstractOtpOperator method decryptAttributeValue.
/**
* Decrypt the given string using the PWM encryption key.
*/
public String decryptAttributeValue(final String encrypted) throws PwmUnrecoverableException, PwmOperationalException {
final PwmBlockAlgorithm pwmBlockAlgorithm = figureBlockAlg();
final PwmSecurityKey pwmSecurityKey = pwmApplication.getConfig().getSecurityKey();
return SecureEngine.decryptStringValue(encrypted, pwmSecurityKey, pwmBlockAlgorithm);
}
use of password.pwm.util.secure.PwmBlockAlgorithm in project pwm by pwm-project.
the class AbstractOtpOperator method encryptAttributeValue.
/**
* Encrypt the given string using the PWM encryption key.
*/
public String encryptAttributeValue(final String unencrypted) throws PwmUnrecoverableException, PwmOperationalException {
final PwmBlockAlgorithm pwmBlockAlgorithm = figureBlockAlg();
final PwmSecurityKey pwmSecurityKey = pwmApplication.getConfig().getSecurityKey();
return SecureEngine.encryptToString(unencrypted, pwmSecurityKey, pwmBlockAlgorithm);
}
Aggregations