Class CryptoService
- java.lang.Object
-
- fr.paris.lutece.util.keydiversification.CryptoService
-
public class CryptoService extends Object
This service encrypts / decrypts strings
-
-
Constructor Summary
Constructors Constructor Description CryptoService(String strEncryptionKey)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdecrypt(String strEncrypted)Decrypts the specified stringStringencrypt(String strSource)Encrypts the specified string
-
-
-
Constructor Detail
-
CryptoService
public CryptoService(String strEncryptionKey) throws KeyDiversificationException
Constructor- Parameters:
strEncryptionKey- An encryption key- Throws:
KeyDiversificationException- If an error occursInvalidKeyExceptionNoSuchAlgorithmExceptionNoSuchPaddingExceptionInvalidKeySpecException
-
-
Method Detail
-
encrypt
public String encrypt(String strSource) throws KeyDiversificationException
Encrypts the specified string- Parameters:
strSource- the string to encrypt- Returns:
- The encrypted string
- Throws:
KeyDiversificationException- if there is an error during the treatment
-
decrypt
public String decrypt(String strEncrypted) throws KeyDiversificationException
Decrypts the specified string- Parameters:
strEncrypted- The encrypted string- Returns:
- The decrypted string
- Throws:
KeyDiversificationException- if there is an error during the treatment
-
-