85 references to ZipEncryptionMethod
System.IO.Compression (64)
System\IO\Compression\ZipArchive.cs (2)
304public ZipArchiveEntry CreateEntry(string entryName, ReadOnlySpan<char> password, ZipEncryptionMethod encryptionMethod) 327public ZipArchiveEntry CreateEntry(string entryName, CompressionLevel compressionLevel, ReadOnlySpan<char> password, ZipEncryptionMethod encryptionMethod)
System\IO\Compression\ZipArchiveEntry.Async.cs (9)
229if (Encryption == ZipEncryptionMethod.Unknown) 310if (Encryption == ZipEncryptionMethod.Unknown) 518if (Encryption == ZipEncryptionMethod.Unknown) 750if (Encryption == ZipEncryptionMethod.ZipCrypto && _derivedZipCryptoKeyMaterial != null) 893ZipEncryptionMethod savedEncryption = Encryption; 901if (savedEncryption is ZipEncryptionMethod.Aes128 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes256) 904Encryption = ZipEncryptionMethod.None;
System\IO\Compression\ZipArchiveEntry.cs (53)
49private ZipEncryptionMethod _encryptionMethod; 931 => ZipEncryptionMethod.Aes128, 942 => ZipEncryptionMethod.Aes192, 953 => ZipEncryptionMethod.Aes256, 103Encryption = ZipEncryptionMethod.Unknown; 108Encryption = ZipEncryptionMethod.ZipCrypto; 229/// <see cref="ZipEncryptionMethod.None"/> if the entry is not encrypted; 230/// <see cref="ZipEncryptionMethod.Unknown"/> if the entry uses an unsupported encryption method; 231/// otherwise, the specific encryption method (e.g., <see cref="ZipEncryptionMethod.ZipCrypto"/>, 232/// <see cref="ZipEncryptionMethod.Aes128"/>, <see cref="ZipEncryptionMethod.Aes192"/>, 233/// or <see cref="ZipEncryptionMethod.Aes256"/>). 235public ZipEncryptionMethod EncryptionMethod => _encryptionMethod; 1058private bool UseAesEncryption => Encryption is ZipEncryptionMethod.Aes128 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes256; 1062private static int GetAesKeySizeBits(ZipEncryptionMethod encryption) 1068ZipEncryptionMethod.Aes128 => 128, 1069ZipEncryptionMethod.Aes192 => 192, 1070ZipEncryptionMethod.Aes256 => 256, 1081if (Encryption == ZipEncryptionMethod.Unknown) 1208ZipEncryptionMethod encryptionMethod = Encryption; 1214if (encryptionMethod == ZipEncryptionMethod.ZipCrypto) 1230else if (encryptionMethod is ZipEncryptionMethod.Aes256 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes128) 1244bool isAesEncryption = encryptionMethod is ZipEncryptionMethod.Aes256 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes128; 1256streamForPosition: encryptionMethod != ZipEncryptionMethod.None ? _archive.ArchiveStream : null); 1270if (Encryption == ZipEncryptionMethod.Unknown) 1353Encryption = ZipEncryptionMethod.ZipCrypto; 1367/// Called by <see cref="ZipArchive.CreateEntry(string, ReadOnlySpan{char}, ZipEncryptionMethod)"/>. 1369internal void PrepareEncryption(ReadOnlySpan<char> password, ZipEncryptionMethod encryptionMethod) 1376if (encryptionMethod == ZipEncryptionMethod.ZipCrypto) 1381else if (encryptionMethod is ZipEncryptionMethod.Aes128 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes256) 1405ZipEncryptionMethod.Aes128 => (byte)1, 1406ZipEncryptionMethod.Aes192 => (byte)2, 1407ZipEncryptionMethod.Aes256 => (byte)3, 1577internal ZipEncryptionMethod Encryption { get => _encryptionMethod; private set => _encryptionMethod = value; } 1608if (Encryption == ZipEncryptionMethod.ZipCrypto) 1717else if (Encryption != ZipEncryptionMethod.ZipCrypto) 1799if (Encryption == ZipEncryptionMethod.ZipCrypto && _derivedZipCryptoKeyMaterial is not null) 1902ZipEncryptionMethod savedEncryption = Encryption; 1910if (savedEncryption is ZipEncryptionMethod.Aes128 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes256) 1913Encryption = ZipEncryptionMethod.None; 2221private readonly ZipEncryptionMethod _encryption; 2226public 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)
445if (options.EncryptionMethod != ZipEncryptionMethod.None && options.Password.IsEmpty) 472if (options.EncryptionMethod != ZipEncryptionMethod.None && options.Password.IsEmpty) 522ReadOnlyMemory<char> password = default, ZipEncryptionMethod encryptionMethod = ZipEncryptionMethod.None, CancellationToken cancellationToken = default)
System\IO\Compression\ZipFile.Create.cs (4)
414if (options.EncryptionMethod != ZipEncryptionMethod.None && options.Password.IsEmpty) 436if (options.EncryptionMethod != ZipEncryptionMethod.None && options.Password.IsEmpty) 472ReadOnlySpan<char> password = default, ZipEncryptionMethod encryptionMethod = ZipEncryptionMethod.None)
System\IO\Compression\ZipFileCreationOptions.cs (1)
21public ZipEncryptionMethod EncryptionMethod { get; set; }
System\IO\Compression\ZipFileExtensions.ZipArchive.Create.Async.cs (4)
75string sourceFileName, string entryName, ReadOnlyMemory<char> password, ZipEncryptionMethod encryption, CancellationToken cancellationToken = default) => 139string sourceFileName, string entryName, CompressionLevel compressionLevel, ReadOnlyMemory<char> password, ZipEncryptionMethod encryption, CancellationToken cancellationToken = default) => 143CompressionLevel? compressionLevel, ReadOnlyMemory<char> password = default, ZipEncryptionMethod encryption = ZipEncryptionMethod.None, CancellationToken cancellationToken = default)
System\IO\Compression\ZipFileExtensions.ZipArchive.Create.cs (8)
91public static ZipArchiveEntry CreateEntryFromFile(this ZipArchive destination, string sourceFileName, string entryName, ReadOnlySpan<char> password, ZipEncryptionMethod encryption) => 126ReadOnlySpan<char> password, ZipEncryptionMethod encryption) => 131ReadOnlySpan<char> password = default, ZipEncryptionMethod encryption = ZipEncryptionMethod.None) 147private static (FileStream, ZipArchiveEntry) InitializeDoCreateEntryFromFile(ZipArchive destination, string sourceFileName, string entryName, CompressionLevel? compressionLevel, bool useAsync, ReadOnlySpan<char> password = default, ZipEncryptionMethod encryption = ZipEncryptionMethod.None) 160if (encryption != ZipEncryptionMethod.None && password.IsEmpty) 167if (encryption != ZipEncryptionMethod.None)