6.4 Get Locking Key
Most developers do not need to use this function, and should instead rely on appropriate lock/unlock methods for encrypting and decrypting all data. This is meant only for highly advanced use-cases where the developer needs to use some custom encryption algorithm and/or explicitly add/validate signatures on some special piece of data or stream which can’t be easily passed to standard lock/unlock methods. In this case, the keys returned by this function should be used very carefully for a single object or stream, and then destroyed immediately after encryption/decryption or signature generation/verification is done.
The getLockingKey
function of BayunCore
class returns locking key along with the keys for signature generation and signature verification for an encryption policy.
The function takes the following parameters :
encryptionPolicy : BayunEncryptionPolicy determines the key to be used to generate the lockingKey.
keyGenerationPolicy : BayunKeyGenerationPolicy determine the policy to be used to generate the lockingKey.
groupId : GroupId is required if encryptionPolicy is
BayunEncryptionPolicyGroup
. If encryption-policy is other thanBayunEncryptionPolicyGroup
then groupId should be empty string.
The getLockingKey
function returns a struct LockingKeys
.
Last updated
Was this helpful?