PSPDFDatabaseEncryptionProvider
Objective-C
@protocol PSPDFDatabaseEncryptionProvider <NSObject>
Swift
protocol DatabaseEncryptionProvider : NSObjectProtocol
Support for database encryption. If you intend to use database encryption features, you must provide
an implementation of PSPDFDatabaseEncryptionProvider
by setting -[PSPDFKitGlobal setDatabaseEncryptionProvider:]
.
-
The encryption provider must perform the necessary steps to encrypt the given
db
with the givenkeyData
. Most implementations will callsqlite3_key(db, keyData.bytes, keyData.length)
. Returntrue
if no errors occurred, andfalse
otherwise.Declaration
Objective-C
- (BOOL)encryptDatabase:(nonnull void *)db withKey:(nonnull NSData *)keyData;
Swift
func encryptDatabase(_ db: UnsafeMutableRawPointer, withKey keyData: Data) -> Bool
-
The encryption provider must perform the necessary steps to re-encrypt the given
db
with the givenkeyData
. Most implementations will callsqlite3_rekey(db, keyData.bytes, keyData.length)
. Returntrue
if no errors occurred, andfalse
otherwise.Declaration
Objective-C
- (BOOL)reEncryptDatabase:(nonnull void *)db withKey:(nonnull NSData *)keyData;
Swift
func reEncryptDatabase(_ db: UnsafeMutableRawPointer, withKey keyData: Data) -> Bool