Package lumis.portal.crypto
Interface ICipher
-
- All Known Subinterfaces:
ICipherSpi
- All Known Implementing Classes:
AbstractCipher
,MessageDigestCipher
,SymmetricCipher
@StableMinor(version="17.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$ $Date$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
decrypt(byte[] value)
Decrypts an array of bytes.java.lang.String
decrypt(java.lang.String value)
Decrypts a string.byte[]
encrypt(byte[] value)
Encrypts an array of bytes.java.lang.String
encrypt(java.lang.String value)
Encrypts a string.
-
-
-
Method Detail
-
encrypt
java.lang.String encrypt(java.lang.String value)
Encrypts a string.- Parameters:
value
- the original string.- Returns:
- the encrypted string.
- Throws:
java.lang.IllegalArgumentException
- ifvalue
isnull
.- Since:
- 5.5.0
-
decrypt
java.lang.String decrypt(java.lang.String value) throws InvalidEncryptedValueException
Decrypts a string.- Parameters:
value
- the encrypted string.- Returns:
- the string decrypted.
- Throws:
java.lang.IllegalArgumentException
- ifvalue
isnull
.InvalidEncryptedValueException
- ifvalue
is incompatible with this cipher (probably was not encrypted by it or is corrupted).java.lang.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:
java.lang.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:
java.lang.UnsupportedOperationException
- if this is a one-way cipher and does not support decryption.java.lang.IllegalArgumentException
- ifvalue
isnull
.InvalidEncryptedValueException
- ifvalue
is incompatible with this cipher (probably was not encrypted by it or is corrupted).- Since:
- 5.5.0
-
-