public class CryptoService extends Object
| Constructor and Description |
|---|
CryptoService() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] encrypted) |
static byte[] |
decrypt(byte[] encrypted,
String algorithm,
SecretKey key) |
InputStream |
decrypt(InputStream encrypted) |
static InputStream |
decrypt(InputStream encryptedInputStream,
String algorithm,
SecretKey key) |
String |
decrypt(String encrypted) |
byte[] |
encrypt(byte[] decrypted) |
static byte[] |
encrypt(byte[] decrypted,
String algorithm,
SecretKey key) |
InputStream |
encrypt(InputStream decrypted) |
static InputStream |
encrypt(InputStream decryptedInputStream,
String algorithm,
SecretKey key) |
String |
encrypt(String decrypted) |
long |
getFileSize(Long originalSize) |
static CryptoService |
getInstance() |
String |
getTypeAlgo() |
public String getTypeAlgo()
public static CryptoService getInstance()
public String encrypt(String decrypted) throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionpublic String decrypt(String encrypted) throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionpublic byte[] encrypt(byte[] decrypted)
throws GeneralSecurityException,
IOException
GeneralSecurityExceptionIOExceptionpublic byte[] decrypt(byte[] encrypted)
throws GeneralSecurityException,
IOException
GeneralSecurityExceptionIOExceptionpublic InputStream encrypt(InputStream decrypted) throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionpublic InputStream decrypt(InputStream encrypted) throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionpublic static byte[] encrypt(byte[] decrypted,
String algorithm,
SecretKey key)
throws BadPaddingException,
IllegalBlockSizeException,
InvalidKeyException,
NoSuchPaddingException,
NoSuchAlgorithmException
public static byte[] decrypt(byte[] encrypted,
String algorithm,
SecretKey key)
throws BadPaddingException,
IllegalBlockSizeException,
InvalidKeyException,
NoSuchPaddingException,
NoSuchAlgorithmException
public static InputStream decrypt(InputStream encryptedInputStream, String algorithm, SecretKey key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException
public static InputStream encrypt(InputStream decryptedInputStream, String algorithm, SecretKey key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException
public long getFileSize(Long originalSize)
Copyright © 2022 MANYDESIGNS s.r.l.. All rights reserved.