SolFSStorage.SetEncryption method


Pascal    Plain C    C++ (DLL/Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

SolFSStorage     See also    


Encrypts or decrypts the storage.


    procedure SetEncryption(Encryption: TSolFSEncryption; OldPassword, NewPassword: String);

[Plain C]
    long _stdcall StorageSetEncryption(unsigned long Storage, unsigned long Encryption, wchar_t* OldPassword, unsigned long OldPasswordLen, wchar_t* NewPassword, unsigned long NewPasswordLen);

[C++ (DLL/Lib)]
    void SetEncryption(SolFSEncryption Encryption, unsigned short * OldPassword, unsigned short * NewPassword);

[C++ (VCL)]
    void __fastcall SetEncryption(TSolFSEncryption Encryption, TSolFSString OldPassword, TSolFSString NewPassword);

[C++ (.NET)]
    void SetEncryption( SolFSEncryption encryption, String *oldPassword, String *newPassword )

    void SetEncryption( SolFSEncryption encryption, String oldPassword, String newPassword )

    Sub SetEncryption( ByVal encryption As SolFSEncryption, ByVal oldPassword As String, ByVal newPassword As String)

    void setEncryption( SolFSEncryption encryption, String oldPassword, String newPassword)


  • Encryption - new encryption mode.
  • OldPassword - current encryption password if the storage is encrypted or the empty string otherwise.
  • NewPassword - the password to be used with new encryption mode (if any).
  • [Plain C] Storage - handle to the storage returned by Create or Open function.
  • [Plain C] OldPasswordLen - length of the old password in bytes (not counting the ending NULL).
  • [Plain C] NewPasswordLen - length of the new password in bytes (not counting the ending NULL).

Values of SolFSEncryption

[Plain C]  Return values

0 if the function succeeded or one of Error codes if the function failed.


Use SetEncryption to change encryption method or password for the whole-storage encryption.

If you use custom encryption, you must provide handlers for OnDataEncrypt, OnDataDecrypt, OnHashValidate and OnHashCalculate events.

See also

StorageEncryption     StoragePassword     CheckPassword