This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v18.4
dataStore.encryptionStatus( )
|
dataStore.encryptionStatus () -> Result | ||||||||
Parameter | Type | Description | ||||||
Result | Object |
![]() |
Information about the encryption of the current datastore and of each table | |||||
The dataStore.encryptionStatus( ) command returns an object providing the encryption status for the current data file (i.e., the data file of the ds datastore). The status for each table is also provided.
Notes:
Returned value
The returned object contains the following properties:
Property | Type | Description | ||
isEncrypted | Boolean | True if the data file is encrypted | ||
keyProvided | Boolean | True if the encryption key matching the encrypted data file is provided(*). | ||
tables | Object | Object containing as many properties as there are encryptable or encrypted tables. | ||
<table name> | Object | Encryptable or Encrypted table | ||
name | Text | Name of the table | ||
num | Number | Table number | ||
isEncryptable | Boolean | True if the table is declared encryptable in the structure file | ||
isEncrypted | Boolean | True if the records of the table are encrypted in the data file |
(*) The encryption key can be provided:
You want to know the number of encrypted tables in the current data file:
C_OBJECT($status)
$status:=dataStore.encryptionStatus()
If($status.isEncrypted) //the database is encrypted
C_LONGINT($vcount)
C_TEXT($tabName)
For each($tabName;$status.tables)
If($status.tables[$tabName].isEncrypted)
$vcount:=$vcount+1
End if
End for each
ALERT(String($vcount)+" encrypted table(s) in this datastore.")
Else
ALERT("This database is not encrypted.")
End if
4D Blog - New 4D commands to work with encrypted data
Data file encryption status
Product: 4D
Theme: ORDA - DataStore
Created: 4D v17 R5
4D Language Reference ( 4D v18)
4D Language Reference ( 4D v18.4)
4D Language Reference ( 4D v18.6)