6.3 Lock/Unlock Data
6.3.1 Lock Data
The lockData
method of BayunCore
class locks generic data of type byteArray with default BayunEncryptionPolicy and BayunKeyGenerationPolicy dictated by server settings.
Parameters
data : Byte Array to be locked.
success : Success block to be executed after data is successfully locked, returns locked data through key "lockedData".
failure : Failure block to be executed if locking fails, returns BayunError.
6.3.2 Lock Data with Encryption Policy, Key Generation Policy
The lockData
method with encryption policy, key generation policy as parameters locks data with the encryption key dictated by the policy.
Parameters
data : Byte Array to be locked.
encryptionPolicy : BayunEncryptionPolicy determines the key for locking.
keyGenerationPolicy : BayunKeyGenerationPolicy determines the policy to generate the data encryption key.
groupId : GroupId is required if encryptionPolicy is
BayunEncryptionPolicyGroup
.success : Success block to be executed after data is successfully locked, returns locked data through key "lockedData".
failure : Failure block to be executed if locking fails, returns BayunError.
If encryption-policy is other than BayunEncryptionPolicyGroup
then groupId should be null.
6.3.3 Unlock Data
The unlockData
method of BayunCore
class unlocks generic data of type byteArray.
Parameters
data : Byte Array to be unlocked.
success : Success block to be executed after data is successfully unlocked, returns unlocked data through key "unlockedData".
failure : Failure block to be executed if unlocking fails, returns
BayunError
.
Last updated