Package lumis.portal.crypto
Interface ICipher
-
- All Known Subinterfaces:
ICipherSpi
- All Known Implementing Classes:
AbstractCipher
,MessageDigestCipher
,SymmetricCipher
@StableMinor(version="14.0", sinceVersion="5.5") public interface ICipher
Defines the methods a cipher must implement. The cipher implementation must be thread-safe.- Since:
- 5.5.0
- Version:
- $Revision: 24477 $ $Date: 2021-04-28 11:30:36 -0300 (Wed, 28 Apr 2021) $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
decrypt(byte[] value)
Decrypts an array of bytes.String
decrypt(String value)
Decrypts a string.byte[]
encrypt(byte[] value)
Encrypts an array of bytes.String
encrypt(String value)
Encrypts a string.
-
-
-
Method Detail
-
encrypt
String encrypt(String value)
Encrypts a string.- Parameters:
value
- the original string.- Returns:
- the encrypted string.
- Throws:
IllegalArgumentException
- ifvalue
isnull
.- Since:
- 5.5.0
-
decrypt
String decrypt(String value) throws InvalidEncryptedValueException
Decrypts a string.- Parameters:
value
- the encrypted string.- Returns:
- the string decrypted.
- Throws:
IllegalArgumentException
- ifvalue
isnull
.InvalidEncryptedValueException
- ifvalue
is incompatible with this cipher (probably was not encrypted by it or is corrupted).UnsupportedOperationException
- if this is a one-way cipher and does not support decryption.- Since:
- 5.5.0
-
encrypt
byte[] encrypt(byte[] value)
Encrypts an array of bytes.- Parameters:
value
- the original value.- Returns:
- the encrypted value.
- Throws:
IllegalArgumentException
- ifvalue
isnull
.- Since:
- 5.5.0
-
decrypt
byte[] decrypt(byte[] value) throws InvalidEncryptedValueException
Decrypts an array of bytes.- Parameters:
value
- the encrypted value.- Returns:
- the value decrypted.
- Throws:
UnsupportedOperationException
- if this is a one-way cipher and does not support decryption.IllegalArgumentException
- ifvalue
isnull
.InvalidEncryptedValueException
- ifvalue
is incompatible with this cipher (probably was not encrypted by it or is corrupted).- Since:
- 5.5.0
-
-