(Legacy) iOS/tvOS Integrity Check Mechanism iostvos-sdk-storage-integrity-checks
Introduction Intro
Starting with version 3.8.3 of the iOS/tvOS AccessEnabler SDK, the option of performing storage integrity checks is available on AccessEnabler initialization.
In order to use this mechanism, the api was extended with an additional initialization method for the AccessEnabler class.
- (nonnull id) initWithStorageCheck:(IntegrityCheckType)performIntegrityCheck softwareStatement:(nonnull NSString *)softwareStatement;
Integrity checks Checks
The storage integrity checks are useful when corruption of the AccessEnabler storage is suspected (such as when a race condition happens during a read/write storage operation).
The following checks are available to perform on AccessEnabler initialization:
- Storage operability: checks for success on read and write operations
- Stored values integrity: checks that all values are valid and in the expected format
Default behavior Default
The storage integrity checks are turned off by default when initializing AccessEnabler using the default initialization method:
/// SWIFT
let accessEnabler: AccessEnabler = AccessEnaler(softwareStatement)
/// Objective C
AccessEnabler *accessEnabler = [[AccessEnabler alloc] init:softwareStatement];
To explicitly specify which storage integrity checks to be performed on AccessEnabler initialization, use the following initialization method:
/// SWIFT
let accessEnabler: AccessEnabler = AccessEnabler(storageCheck: IntegrityCheckType.INTEGRITY_CHECK_ALL, softwareStatement: softwareStatement)
/// Objective C
AccessEnabler *accessEnabler = [[AccessEnabler alloc] initWithStorageCheck:INTEGRITY_CHECK_ALL softwareStatement:softwareStatement];
IntegrityCheckType Switcher
The IntegrityCheckType enum is exposed to the client application and has the following values:
Validity of stored values
In case any of the integrity checks fail, the user will be logged out