Package org.conical.common.bbl.auth
Class EncryptionUtil
java.lang.Object
org.conical.common.bbl.auth.EncryptionUtil
Encryption utility class provides methods related to string and plain-text encryption.
This class uses the
java.security.MessageDigest
class and thus supports only
a subset of the algorithms supported by that class.- Author:
- rdoherty
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Represents an encryption algorithm -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
encrypt
(String plaintext, EncryptionUtil.Algorithm algorithm) Encrypts the given plain text using the passed algorithm.
-
Constructor Details
-
EncryptionUtil
public EncryptionUtil()
-
-
Method Details
-
encrypt
Encrypts the given plain text using the passed algorithm. The result is then encoded as a Base-64 string and returned.- Parameters:
plaintext
- text to encryptalgorithm
- algorithm to use- Returns:
- Base-64 encoded result of the encryption algorithm
-