This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
Discover data key
|
Discover data key -> Function result | ||||||||
Parameter | Type | Description | ||||||
Function result | Boolean |
![]() |
True if a valid encryption key for the currently open data file has been found, else False | |||||
The Discover data key command searches for a valid encryption key corresponding to the currently opened data file at the root level of all connected devices and returns True if successful.
Connected devices to be searched include USB keys or external disks. A valid encryption key is necessary to allow read/write access to an encrypted database. This command can be called, for example, at database startup, after the user has been invited to connect a USB key.
Key files (".4DKeyChain" extension files) must be stored at the top level of connected devices (the search will not go through the folder hierarchy). Encryption keys must be saved in JSON format (see Storing data encryption keys in files in the 4D Design Reference).
Returned value
C_OBJECT($status)
C_BOOLEAN($keyFound)
$status:=ds.encryptionStatus()
If(($status.isEncrypted)&(Not($status.keyProvided))) //no key is available
// thus access to encrypted data is not allowed
$keyFound:=Discover data key
If($keyFound=True)
ALERT("A valid encryption key has been found.")
End if
End if
4D Blog - New 4D commands to work with encrypted data
New data key
Product: 4D
Theme: Data Security
Number:
1639
Created: 4D v17 R5
4D Language Reference ( 4D v20 R7)