84 references to ZipEncryptionMethod
System.IO.Compression (63)
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 (12)
229if (Encryption == ZipEncryptionMethod.Unknown) 254else if (EncryptionMethod == ZipEncryptionMethod.ZipCrypto) 310if (Encryption == ZipEncryptionMethod.Unknown) 518if (Encryption == ZipEncryptionMethod.Unknown) 555if (EncryptionMethod == ZipEncryptionMethod.ZipCrypto) 750if (Encryption == ZipEncryptionMethod.ZipCrypto && _derivedZipCryptoKeyMaterial != null) 882bool emptyEncryptedEntry = _uncompressedSize == 0 && Encryption != ZipEncryptionMethod.None; 894ZipEncryptionMethod savedEncryption = Encryption; 902if (savedEncryption is ZipEncryptionMethod.Aes128 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes256) 905Encryption = ZipEncryptionMethod.None;
System\IO\Compression\ZipArchiveEntry.cs (49)
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; 1055private bool IsAesEncrypted => EncryptionMethod is ZipEncryptionMethod.Aes128 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes256; 1057private static int GetAesKeySizeBits(ZipEncryptionMethod encryption) 1063ZipEncryptionMethod.Aes128 => 128, 1064ZipEncryptionMethod.Aes192 => 192, 1065ZipEncryptionMethod.Aes256 => 256, 1076if (Encryption == ZipEncryptionMethod.Unknown) 1102if (EncryptionMethod == ZipEncryptionMethod.ZipCrypto) 1203ZipEncryptionMethod encryptionMethod = Encryption; 1209if (encryptionMethod == ZipEncryptionMethod.ZipCrypto) 1249streamForPosition: encryptionMethod != ZipEncryptionMethod.None ? _archive.ArchiveStream : null); 1263if (Encryption == ZipEncryptionMethod.Unknown) 1343if (EncryptionMethod == ZipEncryptionMethod.ZipCrypto) 1358/// Called by <see cref="ZipArchive.CreateEntry(string, ReadOnlySpan{char}, ZipEncryptionMethod)"/>. 1360internal void PrepareEncryption(ReadOnlySpan<char> password, ZipEncryptionMethod encryptionMethod) 1367if (encryptionMethod == ZipEncryptionMethod.ZipCrypto) 1372else if (encryptionMethod is ZipEncryptionMethod.Aes128 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes256) 1396ZipEncryptionMethod.Aes128 => (byte)1, 1397ZipEncryptionMethod.Aes192 => (byte)2, 1398ZipEncryptionMethod.Aes256 => (byte)3, 1568internal ZipEncryptionMethod Encryption { get => _encryptionMethod; private set => _encryptionMethod = value; } 1599if (Encryption == ZipEncryptionMethod.ZipCrypto) 1715else if (Encryption != ZipEncryptionMethod.ZipCrypto) 1797if (Encryption == ZipEncryptionMethod.ZipCrypto && _derivedZipCryptoKeyMaterial is not null) 1889bool emptyEncryptedEntry = _uncompressedSize == 0 && Encryption != ZipEncryptionMethod.None; 1901ZipEncryptionMethod savedEncryption = Encryption; 1909if (savedEncryption is ZipEncryptionMethod.Aes128 or ZipEncryptionMethod.Aes192 or ZipEncryptionMethod.Aes256) 1912Encryption = ZipEncryptionMethod.None; 2220private readonly ZipEncryptionMethod _encryption; 2225public 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)