public interface CryptoAlgorithm
Modifier and Type | Method and Description |
---|---|
String |
encrypt(String value)
Performs the actual encryption.
|
void |
setCipher(String cipher)
Algorithms that perform multiple ciphers get told
with setCipher, which cipher to use.
|
void |
setSeed(String salt)
Allows the user to set a salt value whenever the
algorithm is used.
|
void setSeed(String salt)
Algorithms that do not use a salt are allowed to ignore this parameter.
Algorithms must be able to deal with the null value as salt. They should treat it as "use a random salt".
salt
- The salt valueString encrypt(String value) throws Exception
value
- The value to be encryptedException
- various errors from the underlying ciphers.
The caller should catch them and report accordingly.void setCipher(String cipher)
cipher
- The cipher to use.Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.