Search in sources :

Example 1 with PwmBlockAlgorithm

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);
}
Also used : PwmSecurityKey(password.pwm.util.secure.PwmSecurityKey) PwmBlockAlgorithm(password.pwm.util.secure.PwmBlockAlgorithm)

Example 2 with 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);
}
Also used : PwmSecurityKey(password.pwm.util.secure.PwmSecurityKey) PwmBlockAlgorithm(password.pwm.util.secure.PwmBlockAlgorithm)

Aggregations

PwmBlockAlgorithm (password.pwm.util.secure.PwmBlockAlgorithm)2 PwmSecurityKey (password.pwm.util.secure.PwmSecurityKey)2