Skip to main content

Storage and Encryption | iOS Document Scanner

The Scanbot SDK comes with built-in image storage. You can store scanned images using either keyed or indexed storage. We provide convenient interfaces for this via the SBSDKKeyedImageStorage and SBSDKIndexedImageStorage classes.

SBSDKKeyedImageStorage is a simple thread-safe multiple-reader-single-writer key-value fashioned disk image cache class. This class manages images in a dictionary-like fashion.

SBSDKIndexedImageStorage is a simple thread-safe multiple-reader-single-writer index-based disk image cache class. This class manages images in an array-like fashion.

Both classes support JPEG (recommended) and PNG image file formats represented in SBSDKImageFileFormat Enumeration.

Encryption

Both classes support encryption, ensuring your data is stored securely.

We now offer enhanced encryption capabilities, including:

AES-GCM Encryption/Decryption: Support for the AES-GCM algorithm with random 96-bit initialization vectors and variable-length authentication tags, meeting the requirements for ePA-FdV certification by gematik and BSI. See the SBSDKAESGCMEncrypter class.

Advanced Key Derivation: New options for encryption key derivation, including PBKDF2, HKDF, and random key generation with variable key lengths (128 and 256 bits). These are available for both the standard AES encrypter (SBSDKAESEncrypter) and the new AES-GCM encrypter (SBSDKAESGCMEncrypter). See SBSDKStorageCryptingKeyGenerator, SBSDKRandomKeyGenerator, SBSDKPBKDF2KeyGenerator, and SBSDKHKDFKeyGenerator.

Protocol-Based Key Management: The new SBSDKStorageCryptingKeyProvider protocol enables flexible encryption key management. For example, the SBSDKVolatileKeyProvider class provides in-memory storage, restoration, and deletion of encryption keys. You can also implement custom key providers for persistent storage (e.g., keychain or file-based storage).

Context-Based Encryption: Added support for encryption/decryption on a per-context basis. Contexts, such as file URLs, are passed to encrypter APIs to enable context-based key derivation.

If the built-in encryption methods do not meet your requirements, you can create your own encrypter by implementing a class conforming to the SBSDKStorageCrypting protocol.

Please note

Encryption is not enabled by default.

For easier access to the device's file system, the Scanbot SDK provides a convenient helper class SBSDKStorageLocation.

Example of creating indexed image storage using SBSDKStorageLocation and built-in AES256 encrypter:

Creating Indexed Image Storage Example
loading...

Examples of some basic operations on Indexed Image storage:

Indexed Image Storage Operations Example
loading...

Examples of some basic operations on Keyed Image storage:

Keyed Image Storage Operations Example
loading...

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get your free Trial License

What do you think of this documentation?