85 references to ZipEncryptionMethod
System.IO.Compression (64)
System\IO\Compression\ZipArchive.cs (2)
304
public ZipArchiveEntry CreateEntry(string entryName, ReadOnlySpan<char> password,
ZipEncryptionMethod
encryptionMethod)
327
public ZipArchiveEntry CreateEntry(string entryName, CompressionLevel compressionLevel, ReadOnlySpan<char> password,
ZipEncryptionMethod
encryptionMethod)
System\IO\Compression\ZipArchiveEntry.Async.cs (12)
229
if (Encryption ==
ZipEncryptionMethod
.Unknown)
254
else if (EncryptionMethod ==
ZipEncryptionMethod
.ZipCrypto)
310
if (Encryption ==
ZipEncryptionMethod
.Unknown)
518
if (Encryption ==
ZipEncryptionMethod
.Unknown)
555
if (EncryptionMethod ==
ZipEncryptionMethod
.ZipCrypto)
750
if (Encryption ==
ZipEncryptionMethod
.ZipCrypto && _derivedZipCryptoKeyMaterial != null)
882
bool emptyEncryptedEntry = _uncompressedSize == 0 && Encryption !=
ZipEncryptionMethod
.None;
894
ZipEncryptionMethod
savedEncryption = Encryption;
902
if (savedEncryption is
ZipEncryptionMethod
.Aes128 or
ZipEncryptionMethod
.Aes192 or
ZipEncryptionMethod
.Aes256)
905
Encryption =
ZipEncryptionMethod
.None;
System\IO\Compression\ZipArchiveEntry.cs (50)
54
private
ZipEncryptionMethod
_encryptionMethod;
98
1 =>
ZipEncryptionMethod
.Aes128,
99
2 =>
ZipEncryptionMethod
.Aes192,
100
3 =>
ZipEncryptionMethod
.Aes256,
108
Encryption =
ZipEncryptionMethod
.Unknown;
113
Encryption =
ZipEncryptionMethod
.ZipCrypto;
238
/// <see cref="
ZipEncryptionMethod
.None"/> if the entry is not encrypted;
239
/// <see cref="
ZipEncryptionMethod
.Unknown"/> if the entry uses an unsupported encryption method;
240
/// otherwise, the specific encryption method (e.g., <see cref="
ZipEncryptionMethod
.ZipCrypto"/>,
241
/// <see cref="
ZipEncryptionMethod
.Aes128"/>, <see cref="
ZipEncryptionMethod
.Aes192"/>,
242
/// or <see cref="
ZipEncryptionMethod
.Aes256"/>).
244
public
ZipEncryptionMethod
EncryptionMethod => _encryptionMethod;
1078
&& Encryption ==
ZipEncryptionMethod
.ZipCrypto
1087
private bool IsAesEncrypted => EncryptionMethod is
ZipEncryptionMethod
.Aes128 or
ZipEncryptionMethod
.Aes192 or
ZipEncryptionMethod
.Aes256;
1089
private static int GetAesKeySizeBits(
ZipEncryptionMethod
encryption)
1095
ZipEncryptionMethod
.Aes128 => 128,
1096
ZipEncryptionMethod
.Aes192 => 192,
1097
ZipEncryptionMethod
.Aes256 => 256,
1108
if (Encryption ==
ZipEncryptionMethod
.Unknown)
1134
if (EncryptionMethod ==
ZipEncryptionMethod
.ZipCrypto)
1235
ZipEncryptionMethod
encryptionMethod = Encryption;
1241
if (encryptionMethod ==
ZipEncryptionMethod
.ZipCrypto)
1281
streamForPosition: encryptionMethod !=
ZipEncryptionMethod
.None ? _archive.ArchiveStream : null);
1295
if (Encryption ==
ZipEncryptionMethod
.Unknown)
1375
if (EncryptionMethod ==
ZipEncryptionMethod
.ZipCrypto)
1390
/// Called by <see cref="ZipArchive.CreateEntry(string, ReadOnlySpan{char},
ZipEncryptionMethod
)"/>.
1392
internal void PrepareEncryption(ReadOnlySpan<char> password,
ZipEncryptionMethod
encryptionMethod)
1399
if (encryptionMethod ==
ZipEncryptionMethod
.ZipCrypto)
1404
else if (encryptionMethod is
ZipEncryptionMethod
.Aes128 or
ZipEncryptionMethod
.Aes192 or
ZipEncryptionMethod
.Aes256)
1428
ZipEncryptionMethod
.Aes128 => (byte)1,
1429
ZipEncryptionMethod
.Aes192 => (byte)2,
1430
ZipEncryptionMethod
.Aes256 => (byte)3,
1600
internal
ZipEncryptionMethod
Encryption { get => _encryptionMethod; private set => _encryptionMethod = value; }
1631
if (Encryption ==
ZipEncryptionMethod
.ZipCrypto)
1759
else if (Encryption !=
ZipEncryptionMethod
.ZipCrypto)
1841
if (Encryption ==
ZipEncryptionMethod
.ZipCrypto && _derivedZipCryptoKeyMaterial is not null)
1933
bool emptyEncryptedEntry = _uncompressedSize == 0 && Encryption !=
ZipEncryptionMethod
.None;
1945
ZipEncryptionMethod
savedEncryption = Encryption;
1953
if (savedEncryption is
ZipEncryptionMethod
.Aes128 or
ZipEncryptionMethod
.Aes192 or
ZipEncryptionMethod
.Aes256)
1956
Encryption =
ZipEncryptionMethod
.None;
2264
private readonly
ZipEncryptionMethod
_encryption;
2269
public DirectToArchiveWriterStream(CheckSumAndSizeWriteStream crcSizeStream, ZipArchiveEntry entry,
ZipEncryptionMethod
encryptionMethod =
ZipEncryptionMethod
.None, Stream? encryptionStream = null)
System.IO.Compression.ZipFile (21)
System\IO\Compression\ZipFile.Create.Async.cs (4)
445
if (options.EncryptionMethod !=
ZipEncryptionMethod
.None && options.Password.IsEmpty)
472
if (options.EncryptionMethod !=
ZipEncryptionMethod
.None && options.Password.IsEmpty)
522
ReadOnlyMemory<char> password = default,
ZipEncryptionMethod
encryptionMethod =
ZipEncryptionMethod
.None, CancellationToken cancellationToken = default)
System\IO\Compression\ZipFile.Create.cs (4)
414
if (options.EncryptionMethod !=
ZipEncryptionMethod
.None && options.Password.IsEmpty)
436
if (options.EncryptionMethod !=
ZipEncryptionMethod
.None && options.Password.IsEmpty)
472
ReadOnlySpan<char> password = default,
ZipEncryptionMethod
encryptionMethod =
ZipEncryptionMethod
.None)
System\IO\Compression\ZipFileCreationOptions.cs (1)
21
public
ZipEncryptionMethod
EncryptionMethod { get; set; }
System\IO\Compression\ZipFileExtensions.ZipArchive.Create.Async.cs (4)
75
string sourceFileName, string entryName, ReadOnlyMemory<char> password,
ZipEncryptionMethod
encryption, CancellationToken cancellationToken = default) =>
139
string sourceFileName, string entryName, CompressionLevel compressionLevel, ReadOnlyMemory<char> password,
ZipEncryptionMethod
encryption, CancellationToken cancellationToken = default) =>
143
CompressionLevel? compressionLevel, ReadOnlyMemory<char> password = default,
ZipEncryptionMethod
encryption =
ZipEncryptionMethod
.None, CancellationToken cancellationToken = default)
System\IO\Compression\ZipFileExtensions.ZipArchive.Create.cs (8)
91
public static ZipArchiveEntry CreateEntryFromFile(this ZipArchive destination, string sourceFileName, string entryName, ReadOnlySpan<char> password,
ZipEncryptionMethod
encryption) =>
126
ReadOnlySpan<char> password,
ZipEncryptionMethod
encryption) =>
131
ReadOnlySpan<char> password = default,
ZipEncryptionMethod
encryption =
ZipEncryptionMethod
.None)
147
private static (FileStream, ZipArchiveEntry) InitializeDoCreateEntryFromFile(ZipArchive destination, string sourceFileName, string entryName, CompressionLevel? compressionLevel, bool useAsync, ReadOnlySpan<char> password = default,
ZipEncryptionMethod
encryption =
ZipEncryptionMethod
.None)
160
if (encryption !=
ZipEncryptionMethod
.None && password.IsEmpty)
167
if (encryption !=
ZipEncryptionMethod
.None)