SBSDKStorageCrypting

@protocol SBSDKStorageCrypting <NSObject>

Protocol for implementing encryption and decryption of data.

ScanbotSDK comes with a built-in AES encryptor that currently supports AES128 and AES256. If these algorithms are not meeting your requirements you can create and use your own encryption classes in ScanbotSDKs image storages by simply conforming to this protocol and implementing the two methods.

  • Encrypts the given data blob and returns the encrypted data blob.

    Declaration

    Objective-C

    - (nonnull NSData *)encryptData:(nonnull NSData *)data;

    Swift

    func encryptData(_ data: Data) -> Data

    Parameters

    data

    The data blob to encrypt.

    Return Value

    The encrypted data.

  • Decrypts the given encrypted data blob and returns the decrypted data blob.

    Declaration

    Objective-C

    - (nonnull NSData *)decryptData:(nonnull NSData *)data;

    Swift

    func decryptData(_ data: Data) -> Data

    Parameters

    data

    The data blob to decrypt.

    Return Value

    The decrypted data.