SolFSStorage.CheckFilePassword method
Filter:
Pascal DLL C++ (DLL/Lib) C++ (VCL) C++ (.NET) C# VB.NETOverview
Checks if the password for the file is correct.
Declaration
[Pascal]
function CheckFilePassword(const FileName: WideString; Password: WideString;
EncryptionUnknown: Boolean; Encryption: TSolFSEncryption=ecNoEncryption ): Boolean;
[DLL]
long _stdcall StorageCheckFilePassword(unsigned long Storage, const wchar_t* FileName, unsigned long Encryption,
char EncryptionUnknown, wchar_t* Password, unsigned long PasswordLen, char *Valid);
[C++ (DLL/Lib)]
bool CheckFilePassword(unsigned short *fileName,
unsigned short *password,
bool encryptionUnknown,
SolFSEncryption encryption);
[C++ (VCL)]
bool __fastcall CheckFilePassword(const WideString FileName, String Password, bool EncryptionUnknown,
TSolFSEncryption Encryption=ecNoEncryption);
[C++ (.NET)]
bool CheckFilePassword(String *fileName,
String *password,
bool encryptionUnknown,
SolFSEncryption encryption);
[C#]
bool CheckFilePassword(
String fileName,
String password,
bool encryptionUnknown,
SolFSEncryption encryption);
[VB.NET]
Function CheckFilePassword(
ByVal fileName As String,
ByVal password As String,
ByVal encryptionUnknown As Boolean,
ByVal encryption As SolFSEncryption) As Boolean
Parameters
- FileName - the full file name in the SolFSStorage.
- Password - password you want to check.
- EncryptiomUnknown - set this parameter to True if the type of encryption used is unknown.
- Encryption - set this parameter to encryption type if it is known.
- [DLL] Storage - handle to the storage returned by Create or Open function.
- [DLL] PasswordLen - length of the Password in bytes (not counting terminating NULL).
- [DLL] Valid - returns 1 if password was correct,
0 if password was incorrect.
Return value
True if password was correct.
False if password was incorrect.
[DLL] 0 if the function succeeded or one of Error codes if the function failed.
Values of SolFSEncryption
[Pascal] [DLL] [C++ (VCL)] [C++ (.NET)] [C#] [VB.NET] [ActiveX] [VB]
Value
Meaning
ecNoEncryption
0
Encryption is not used.
ecAES256_SHA256
1
AES (256 bit) is used for encryption and SHA is used for hashing.
ecCustom256
2
Custom encryption is used via callback functions (events).
ecAES256_HMAC256
3
AES (256 bit) is used for encryption and SHA is used for hashing. This mode is recommended for use instead of ecAES256_SHA256.
Description
Use this method to check the password of the file. Set EncryptionUknown to true if the type of encryption used is unknown. Set Encryption parameter to encryption type if it is known.
