#include <ZipCryptograph.h>
The base class for cryptographs used in encryption and decryption of file data.
- See also
- Encryption Methods: How to Best Protect Your Data
◆ EncryptionMethod
The encryption method.
- See also
- Encryption Methods: How to Best Protect Your Data
| Enumerator |
|---|
| encStandard | The traditional zip encryption.
|
| encWinZipAes128 | WinZip AES 128-bit encryption.
|
| encWinZipAes192 | WinZip AES 192-bit encryption.
|
| encWinZipAes256 | WinZip AES 256-bit encryption.
|
| encNone | Indicates no encryption.
|
◆ CanHandle()
| virtual bool CZipCryptograph::CanHandle |
( |
int ZIP_UNUSED | iEncryptionMethod | ) |
|
|
inlinevirtual |
Returns the value indicating whether the current compressor can handle the given encryption method.
- Parameters
-
| iEncryptionMethod | The encryption method to test. It can be one of the EncryptionMethod values. |
- Returns
true, if the current compressor can handle the given encryption method; false otherwise.
◆ CreateCryptograph()
| CZipCryptograph * CZipCryptograph::CreateCryptograph |
( |
int | iEncryptionMethod | ) |
|
|
static |
A factory method that creates an appropriate cryptograph for the given method.
- Parameters
-
| iEncryptionMethod | The encryption method to create a cryptograph for. It can be one of the EncryptionMethod values. |
- Returns
- The new cryptograph. The caller is responsible for destroying the object. If the method is not supported, creates CZipCrc32Cryptograph.
◆ Decode()
| virtual void CZipCryptograph::Decode |
( |
char * | pBuffer, |
|
|
DWORD | uSize ) |
|
pure virtual |
Decodes the given data.
- Parameters
-
| pBuffer | The buffer that holds the data to decode and that receives the results. |
| uSize | The size of pBuffer. |
Implemented in CZipCrc32Cryptograph.
◆ Encode()
| virtual void CZipCryptograph::Encode |
( |
char * | pBuffer, |
|
|
DWORD | uSize ) |
|
pure virtual |
Encodes the given data.
- Parameters
-
| pBuffer | The buffer that holds the data to encode and that receives the results. |
| uSize | The size of pBuffer. |
Implemented in CZipCrc32Cryptograph.
◆ FinishDecode()
The method called at the end of the decoding process.
- Parameters
-
| currentFile | The file being decoded and extracted. |
| storage | The current CZipStorage. |
◆ FinishEncode()
The method called at the end of the decoding process.
- Parameters
-
| currentFile | The file being compressed and encoded. |
| storage | The current CZipStorage. |
◆ GetEncryptedInfoSize()
| DWORD CZipCryptograph::GetEncryptedInfoSize |
( |
int | iEncryptionMethod | ) |
|
|
static |
Returns the total size of the extra data that is added to the compression stream during encryption with the given method.
- Parameters
-
| iEncryptionMethod | The encryption method. It can be one of the EncryptionMethod values. |
- Returns
- The total size of extra data for the given encryption method.
◆ GetEncryptedInfoSizeAfterData()
| DWORD CZipCryptograph::GetEncryptedInfoSizeAfterData |
( |
int | iEncryptionMethod | ) |
|
|
static |
Returns the size of the extra data that is added after the compression stream during encryption with the given method.
- Parameters
-
| iEncryptionMethod | The encryption method. It can be one of the EncryptionMethod values. |
- Returns
- The size of extra data at the end of the compression stream for the given encryption method.
◆ GetEncryptedInfoSizeBeforeData()
| DWORD CZipCryptograph::GetEncryptedInfoSizeBeforeData |
( |
int | iEncryptionMethod | ) |
|
|
static |
Returns the size of the extra data that is added before the compression stream during encryption with the given method.
- Parameters
-
| iEncryptionMethod | The encryption method. It can be one of the EncryptionMethod values. |
- Returns
- The size of extra data at the beginning of the compression stream for the given encryption method.
◆ InitDecode()
| virtual bool CZipCryptograph::InitDecode |
( |
CZipAutoBuffer & | password, |
|
|
CZipFileHeader & | currentFile, |
|
|
CZipStorage & | storage, |
|
|
bool | ignoreCheck ) |
|
pure virtual |
The method called when an existing file is opened for extraction.
- Parameters
-
| password | The supplied password with the CZipArchive::SetPassword method. |
| currentFile | The file being decoded and extracted. |
| storage | The current CZipStorage. |
| ignoreCheck | If true, skips control bytes verifications. |
- Returns
true, if the password is initially considered correct; false otherwise.
Implemented in CZipCrc32Cryptograph.
◆ InitEncode()
The method called when a new file is opened for compression.
- Parameters
-
Implemented in CZipCrc32Cryptograph.
◆ IsEncryptionSupported()
| bool CZipCryptograph::IsEncryptionSupported |
( |
int | iEncryptionMethod | ) |
|
|
inlinestatic |
Returns the value indicating whether the given encryption method is supported by the current compilation of the ZipArchive Library.
- Parameters
-
| iEncryptionMethod | The encryption method to test. It can be one of the EncryptionMethod values. |
- Returns
true, if the method is supported; false otherwise.
◆ IsWinZipAesEncryption()
| bool CZipCryptograph::IsWinZipAesEncryption |
( |
int | iEncryptionMethod | ) |
|
|
inlinestatic |
Returns the value indicating whether the given method is one of the WinZip AES encryption methods.
- Parameters
-
| iEncryptionMethod | The encryption method to test. It can be one of the EncryptionMethod values. |
- Returns
true, if the method is one the WinZip AES encryption methods; false otherwise.
The documentation for this class was generated from the following file: