Function setPassword


#include <include/bitarchivehandler.hpp>

void setPassword(const wstring &password)


Sets up a password to be used by the archive handler.

The password will be used to encrypt/decrypt archives by using the default cryptographic method of the archive format.

Calling setPassword when the input archive is not encrypted does not have effect on the extraction process.
Calling setPassword when the output format doesn't support archive encryption (e.g. GZip, BZip2, etc...) does not have any effects (in other words, it doesn't throw exceptions and it has no effects on compression operations).
After a password has been set, it will be used for every subsequent operation. To disable the use of the password, you need to call the clearPassword method, which is equivalent to call setPassword(L"").

password - the password to be used.


Lines 63-65 in src/bitarchivehandler.cpp. Line 128 in include/bitarchivehandler.hpp.

void BitArchiveHandler::setPassword( const wstring& password ) {
    mPassword = password;

Add Discussion as Guest

Log in