Class CryptoService
- java.lang.Object
-
- fr.paris.lutece.portal.service.util.CryptoService
-
public final class CryptoService extends Object
The Class CryptoService.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringdigest(InputStream stream, String strAlgorithm)Get a digest of the content of a streamstatic Stringencrypt(String strDataToEncrypt, String strAlgorithm)Encrypt a data using an algorithm defined in lutece.propertiesstatic StringgetCryptoKey()Get the cryptographic key of the applicationstatic StringhmacSHA256(String message)Get the HmacSHA256 of a message using the app crypto key.
-
-
-
Method Detail
-
encrypt
public static String encrypt(String strDataToEncrypt, String strAlgorithm)
Encrypt a data using an algorithm defined in lutece.properties- Parameters:
strDataToEncrypt- The data to encryptstrAlgorithm- the algorithm- Returns:
- The encrypted string
-
digest
public static String digest(InputStream stream, String strAlgorithm)
Get a digest of the content of a stream- Parameters:
stream- the stream containing the data to digeststrAlgorithm- the digest Algorithm- Returns:
- hex encoded digest string
- Since:
- 6.0.0
- See Also:
MessageDigest
-
getCryptoKey
public static String getCryptoKey()
Get the cryptographic key of the application- Returns:
- The cryptographic key of the application
-
-