Class EncryptionProvider
- java.lang.Object
-
- net.snowflake.client.jdbc.cloud.storage.EncryptionProvider
-
public class EncryptionProvider extends Object
Handles encryption and decryption using AES CBC (for files) and ECB (for keys).
-
-
Constructor Summary
Constructors Constructor Description EncryptionProvider()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
decrypt(File file, String keyBase64, String ivBase64, net.snowflake.common.core.RemoteStoreFileEncryptionMaterial encMat)
static InputStream
decryptStream(InputStream inputStream, String keyBase64, String ivBase64, net.snowflake.common.core.RemoteStoreFileEncryptionMaterial encMat)
Decrypt a InputStreamstatic CipherInputStream
encrypt(StorageObjectMetadata meta, long originalContentLength, InputStream src, net.snowflake.common.core.RemoteStoreFileEncryptionMaterial encMat, SnowflakeStorageClient client)
-
-
-
Method Detail
-
decryptStream
public static InputStream decryptStream(InputStream inputStream, String keyBase64, String ivBase64, net.snowflake.common.core.RemoteStoreFileEncryptionMaterial encMat) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, InvalidAlgorithmParameterException
Decrypt a InputStream- Parameters:
inputStream
- input streamkeyBase64
- keyBase64ivBase64
- ivBase64encMat
- RemoteStoreFileEncryptionMaterial- Returns:
- InputStream
- Throws:
NoSuchPaddingException
- when padding mechanism is not available for this environmentNoSuchAlgorithmException
- when the requested algorithm is not available for this environmentInvalidKeyException
- when there is an issue with the key valueBadPaddingException
- when the data is not padded as expectedIllegalBlockSizeException
- when the length of data is incorrectInvalidAlgorithmParameterException
- when the provided KeyStore has no trustAnchors
-
decrypt
public static void decrypt(File file, String keyBase64, String ivBase64, net.snowflake.common.core.RemoteStoreFileEncryptionMaterial encMat) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException, IOException
-
encrypt
public static CipherInputStream encrypt(StorageObjectMetadata meta, long originalContentLength, InputStream src, net.snowflake.common.core.RemoteStoreFileEncryptionMaterial encMat, SnowflakeStorageClient client) throws InvalidKeyException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException, NoSuchPaddingException, FileNotFoundException, IllegalBlockSizeException, BadPaddingException
-
-