TraditionalEncryptionSettings
Inheritance: java.lang.Object, com.aspose.zip.EncryptionSettings
public class TraditionalEncryptionSettings extends EncryptionSettings
Settings for traditional ZipCrypto algorithm.
See section 6.0 at ZIP format description: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
Constructors
Constructor | Description |
---|---|
TraditionalEncryptionSettings(String password) | Initializes a new instance of the TraditionalEncryptionSettings class. |
TraditionalEncryptionSettings(String password, Charset encoding) | Initializes a new instance of the TraditionalEncryptionSettings class with user defined encoding. |
TraditionalEncryptionSettings() | Initializes a new instance of the TraditionalEncryptionSettings class without a password. |
TraditionalEncryptionSettings(String password)
public TraditionalEncryptionSettings(String password)
Initializes a new instance of the TraditionalEncryptionSettings class.
try (Archive archive = new Archive(new ArchiveEntrySettings(null, new TraditionalEncryptionSettings("p@s$")))) {
archive.createEntry("data.bin", "data.bin");
archive.save(zipFile);
}
Parameters:
Parameter | Type | Description |
---|---|---|
password | java.lang.String | Password for encryption. |
TraditionalEncryptionSettings(String password, Charset encoding)
public TraditionalEncryptionSettings(String password, Charset encoding)
Initializes a new instance of the TraditionalEncryptionSettings class with user defined encoding.
try (Archive archive = new Archive(new ArchiveEntrySettings(null, new TraditionalEncryptionSettings("p�s$", StandardCharsets.US_ASCII)))) {
archive.createEntry("data.bin", "data.bin");
archive.save(zipFile);
}
Usage of this constructor is discouraged. Setting the encoding may contradict the standard and produce incompatible archive.
Parameters:
Parameter | Type | Description |
---|---|---|
password | java.lang.String | Password for encryption. |
encoding | java.nio.charset.Charset | Encoding for password characters. |
TraditionalEncryptionSettings()
public TraditionalEncryptionSettings()
Initializes a new instance of the TraditionalEncryptionSettings class without a password.