Class AESEncryptedFileIOProcessor
-
- All Implemented Interfaces:
-
io.scanbot.sdk.persistence.fileio.BaseFileIOProcessor
,io.scanbot.sdk.persistence.fileio.FileIOProcessor
,io.scanbot.sdk.persistence.fileio.ImageFileIOProcessor
public final class AESEncryptedFileIOProcessor implements FileIOProcessor
File processor which performs AES based encryption/decryption
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
AESEncryptedFileIOProcessor.AESEncrypterMode
Represents supported AES key sizes
-
Field Summary
Fields Modifier and Type Field Description public final static Integer
kCCKeySizeAES128
public final static Integer
kCCKeySizeAES256
public final static String
DEFAULT_ENCRYPTION_ALGORITHM
public final static String
DEFAULT_KEY_GENERATION_ALGORITHM
public final static String
DEFAULT_KEY_ALGORITHM
private final Boolean
useEncryption
private final SecretKey
key
private final ByteArray
initializationVector
private final ByteArray
salt
private final Integer
iterationCount
private final AESEncryptedFileIOProcessor.AESEncrypterMode
encrypterMode
-
Constructor Summary
Constructors Constructor Description AESEncryptedFileIOProcessor(String password, AESEncryptedFileIOProcessor.AESEncrypterMode encrypterMode)
-
Method Summary
Modifier and Type Method Description Boolean
getUseEncryption()
final SecretKey
getKey()
final ByteArray
getInitializationVector()
final ByteArray
getSalt()
final Integer
getIterationCount()
final AESEncryptedFileIOProcessor.AESEncrypterMode
getEncrypterMode()
Unit
writeImage(Bitmap bitmap, Bitmap.CompressFormat compressFormat, Integer quality, File destination)
Write Bitmap to the destination File Bitmap
readImage(File encryptedSource, BitmapFactory.Options options)
Read Bitmap image from the source File Bitmap
readImage(Uri encryptedSourceUri, BitmapFactory.Options options)
Read Bitmap image from the source file Uri ByteArray
read(File encryptedSource)
Read ByteArray data from the source File Unit
write(ByteArray byteArray, File destination)
Write ByteArray data to the destination File Unit
copyRaw(File encryptedSource, File destination)
Creates a raw copy of the source file to the destination file OutputStream
openFileOutputStream(File destinationFile)
Returns OutputStream for the destination file InputStream
openFileInputStream(File sourceFile)
Returns OutputStream for the source file -
-
Constructor Detail
-
AESEncryptedFileIOProcessor
AESEncryptedFileIOProcessor(String password, AESEncryptedFileIOProcessor.AESEncrypterMode encrypterMode)
-
-
Method Detail
-
getUseEncryption
Boolean getUseEncryption()
-
getInitializationVector
final ByteArray getInitializationVector()
-
getIterationCount
final Integer getIterationCount()
-
getEncrypterMode
final AESEncryptedFileIOProcessor.AESEncrypterMode getEncrypterMode()
-
writeImage
Unit writeImage(Bitmap bitmap, Bitmap.CompressFormat compressFormat, Integer quality, File destination)
- Parameters:
bitmap
- the source Bitmap imagecompressFormat
- Bitmap.CompressFormat The format of the compressed imagequality
- Int Hint to the compressor, 0-100.destination
- the destination file
-
readImage
Bitmap readImage(File encryptedSource, BitmapFactory.Options options)
- Parameters:
encryptedSource
- the source file object, or null if it could not be decoded.
-
readImage
Bitmap readImage(Uri encryptedSourceUri, BitmapFactory.Options options)
-
read
ByteArray read(File encryptedSource)
- Parameters:
encryptedSource
- the source file object, or null if it could not be decoded.
-
write
Unit write(ByteArray byteArray, File destination)
- Parameters:
byteArray
- data to writedestination
- the destination file
-
copyRaw
Unit copyRaw(File encryptedSource, File destination)
Creates a raw copy of the source file to the destination file
-
openFileOutputStream
OutputStream openFileOutputStream(File destinationFile)
Returns OutputStream for the destination file
-
openFileInputStream
InputStream openFileInputStream(File sourceFile)
Returns OutputStream for the source file
-
-
-
-