KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using ds.provideDataKey() with ds.encryptionStatus()
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: August 1, 2023

When working with encrypted data, the ds.provideDataKey() function is useful for providing the encryption key for the current data, especially when 4DKeyChain file is not being used. After executing the function, ds.encryptionStatus().keyProvided can be called to confirm that the proper encryption key was provided.

$status:=ds.provideDataKey("4d4d4d!") // {success:true}
$keyProvided:=ds.encryptionStatus().keyProvided // True

Note that after successfully providing encryption key this way, ds.encryptionStatus().keyProvided remains True until 4D is restarted, even if ds.provideDataKey() is not called again upon reopening the project.