lumis.portal.crypto
Interface ICipher

Package class diagram package ICipher
All Known Subinterfaces:
ICipherSpi
All Known Implementing Classes:
AbstractCipher, MessageDigestCipher, SymmetricCipher

public interface ICipher

Defines the methods a cipher must implement. The cipher implementation must be thread-safe.

Since:
5.5.0

Method Summary
 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 - if value is null.
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 - if value is null.
InvalidEncryptedValueException - if value 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 - if value is null.
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 - if value is null.
InvalidEncryptedValueException - if value is incompatible with this cipher (probably was not encrypted by it or is corrupted).
Since:
5.5.0


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.