EncryptFileA
אבטחה וחתימות
תיאור
The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to EncryptFile and string arguments are interpreted using the current SetAnsiMode code page
מצפין קובץ בדיסק ושומר את התוצאות לקובץ חדש; אין צורך לטעון את כל המסמך לזיכרון, ולכן אפשר להשתמש בפונקציה זו להצפנת מסמכים עצומים
תחביר
Delphi
Function DLEncryptFileA(InstanceID: Integer; InputFileName, OutputFileName, Owner, User: PAnsiChar; Strength, Permissions: Integer): Integer;
DLL
int DLEncryptFileA(int InstanceID, const char * InputFileName, const char * OutputFileName, const char * Owner, const char * User, int Strength, int Permissions);
פרמטרים
| InputFileName | The name of the file to encrypt. |
|---|---|
| OutputFileName | The name of the destination file to create. |
| Owner | The owner password to use for the encrypted file. This is sometimes called the "master" password or the "permissions" password. This password will be needed to change the document. The user password to use for the encrypted file. This is sometimes called the "open" password, it will allow the user to open the document but not to use the document in ways not permitted. |
| User | |
| Strength | חוזק ההצפנה לשימוש: 0 = הצפנת RC4 של 40 סיביות 1 = הצפנת RC4 של 128 סיביות 2 = הצפנת AES של 128 סיביות (דורש Acrobat 7 ואילך) 3 = הצפנת AES של 256 סיביות (דורש Acrobat 9 ואילך) 4 = הצפנת AES של 256 סיביות (דורש Acorbat X ואילך) |
| Permissions | A value created with the EncodePermissions function |
ערכי החזרה
| 0 | The file could not be encrypted. Check the result of the LastErrorCode |
|---|---|
| 1 | The document was encrypted successfully |