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)
215if (Encryption == ZipEncryptionMethod.Unknown) 296if (Encryption == ZipEncryptionMethod.Unknown) 488if (Encryption == ZipEncryptionMethod.Unknown) 720if (Encryption == ZipEncryptionMethod.ZipCrypto && _derivedZipCryptoKeyMaterial != null) 863ZipEncryptionMethod savedEncryption = Encryption; 871if (savedEncryption is ZipEncryptionMethod.Aes128 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes256) 874Encryption = 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; 1044private bool UseAesEncryption => Encryption is ZipEncryptionMethod.Aes128 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes256; 1048private static int GetAesKeySizeBits(ZipEncryptionMethod encryption) 1054ZipEncryptionMethod.Aes128 => 128, 1055ZipEncryptionMethod.Aes192 => 192, 1056ZipEncryptionMethod.Aes256 => 256, 1067if (Encryption == ZipEncryptionMethod.Unknown) 1194ZipEncryptionMethod encryptionMethod = Encryption; 1200if (encryptionMethod == ZipEncryptionMethod.ZipCrypto) 1216else if (encryptionMethod is ZipEncryptionMethod.Aes256 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes128) 1230bool isAesEncryption = encryptionMethod is ZipEncryptionMethod.Aes256 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes128; 1242streamForPosition: encryptionMethod != ZipEncryptionMethod.None ? _archive.ArchiveStream : null); 1256if (Encryption == ZipEncryptionMethod.Unknown) 1325Encryption = ZipEncryptionMethod.ZipCrypto; 1339/// Called by <see cref="ZipArchive.CreateEntry(string, ReadOnlySpan{char}, ZipEncryptionMethod)"/>. 1341internal void PrepareEncryption(ReadOnlySpan<char> password, ZipEncryptionMethod encryptionMethod) 1348if (encryptionMethod == ZipEncryptionMethod.ZipCrypto) 1353else if (encryptionMethod is ZipEncryptionMethod.Aes128 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes256) 1377ZipEncryptionMethod.Aes128 => (byte)1, 1378ZipEncryptionMethod.Aes192 => (byte)2, 1379ZipEncryptionMethod.Aes256 => (byte)3, 1549internal ZipEncryptionMethod Encryption { get => _encryptionMethod; private set => _encryptionMethod = value; } 1580if (Encryption == ZipEncryptionMethod.ZipCrypto) 1689else if (Encryption != ZipEncryptionMethod.ZipCrypto) 1771if (Encryption == ZipEncryptionMethod.ZipCrypto && _derivedZipCryptoKeyMaterial is not null) 1874ZipEncryptionMethod savedEncryption = Encryption; 1882if (savedEncryption is ZipEncryptionMethod.Aes128 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes256) 1885Encryption = ZipEncryptionMethod.None; 2193private readonly ZipEncryptionMethod _encryption; 2198public 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)