Skip to content

Commit 96b5df0

Browse files
Merge pull request #10475 from dotnet/main
Merge main into live
2 parents bd4b2ef + 45b1ff3 commit 96b5df0

File tree

8 files changed

+24
-20
lines changed

8 files changed

+24
-20
lines changed

snippets/csharp/System.Security.Cryptography/Aes/Overview/program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ static byte[] EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)
6060
//Write all data to the stream.
6161
swEncrypt.Write(plainText);
6262
}
63-
encrypted = msEncrypt.ToArray();
6463
}
64+
65+
encrypted = msEncrypt.ToArray();
6566
}
6667
}
6768

snippets/csharp/System.Security.Cryptography/AesCryptoServiceProvider/Overview/program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ static byte[] EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)
5959
//Write all data to the stream.
6060
swEncrypt.Write(plainText);
6161
}
62-
encrypted = msEncrypt.ToArray();
6362
}
63+
64+
encrypted = msEncrypt.ToArray();
6465
}
6566
}
6667

@@ -115,4 +116,4 @@ static string DecryptStringFromBytes_Aes(byte[] cipherText, byte[] Key, byte[] I
115116
//</Snippet3>
116117
}
117118
}
118-
//</Snippet1>
119+
//</Snippet1>

snippets/csharp/System.Security.Cryptography/AesManaged/Overview/program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ static byte[] EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)
5959
//Write all data to the stream.
6060
swEncrypt.Write(plainText);
6161
}
62-
encrypted = msEncrypt.ToArray();
6362
}
63+
64+
encrypted = msEncrypt.ToArray();
6465
}
6566
}
6667

@@ -115,4 +116,4 @@ static string DecryptStringFromBytes_Aes(byte[] cipherText, byte[] Key, byte[] I
115116
//</Snippet3>
116117
}
117118
}
118-
//</Snippet1>
119+
//</Snippet1>

snippets/csharp/System.Security.Cryptography/RijndaelManaged/Overview/class1.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ static byte[] EncryptStringToBytes(string plainText, byte[] Key, byte[] IV)
7070
//Write all data to the stream.
7171
swEncrypt.Write(plainText);
7272
}
73-
encrypted = msEncrypt.ToArray();
7473
}
74+
75+
encrypted = msEncrypt.ToArray();
7576
}
7677
}
7778

xml/System.Security.Cryptography/AesCcm.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ The <paramref name="nonce" /> parameter length is not permitted by <see cref="P:
212212

213213
The <paramref name="tag" /> parameter length is not permitted by <see cref="P:System.Security.Cryptography.AesCcm.TagByteSizes" />.</exception>
214214
<exception cref="T:System.ArgumentNullException">The <paramref name="nonce" />, <paramref name="ciphertext" />, <paramref name="tag" />, or <paramref name="plaintext" /> parameter is <see langword="null" />.</exception>
215-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
215+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
216+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
216217
</Docs>
217218
</Member>
218219
<Member MemberName="Decrypt">
@@ -280,7 +281,8 @@ The <paramref name="nonce" /> parameter length is not permitted by <see cref="P:
280281
-or-
281282

282283
The <paramref name="tag" /> parameter length is not permitted by <see cref="P:System.Security.Cryptography.AesCcm.TagByteSizes" />.</exception>
283-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
284+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
285+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
284286
</Docs>
285287
</Member>
286288
<Member MemberName="Dispose">

xml/System.Security.Cryptography/AesGcm.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,8 @@ The <paramref name="nonce" /> parameter length is not permitted by <see cref="P:
305305

306306
The <paramref name="tag" /> parameter length is not permitted by <see cref="P:System.Security.Cryptography.AesGcm.TagByteSizes" />.</exception>
307307
<exception cref="T:System.ArgumentNullException">The <paramref name="nonce" />, <paramref name="ciphertext" />, <paramref name="tag" />, or <paramref name="plaintext" /> parameter is <see langword="null" />.</exception>
308-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
308+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
309+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
309310
</Docs>
310311
</Member>
311312
<Member MemberName="Decrypt">
@@ -373,7 +374,8 @@ The <paramref name="nonce" /> parameter length is not permitted by <see cref="P:
373374
-or-
374375

375376
The <paramref name="tag" /> parameter length is not permitted by <see cref="P:System.Security.Cryptography.AesGcm.TagByteSizes" />.</exception>
376-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
377+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
378+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
377379
</Docs>
378380
</Member>
379381
<Member MemberName="Dispose">

xml/System.Security.Cryptography/ChaCha20Poly1305.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ The <paramref name="nonce" /> parameter length is not 12 bytes (96 bits).
183183

184184
The <paramref name="tag" /> parameter length is not 16 bytes (128 bits).</exception>
185185
<exception cref="T:System.ArgumentNullException">The <paramref name="nonce" />, <paramref name="ciphertext" />, <paramref name="tag" />, or <paramref name="plaintext" /> parameter is <see langword="null" />.</exception>
186-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
186+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
187+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
187188
</Docs>
188189
</Member>
189190
<Member MemberName="Decrypt">
@@ -238,7 +239,8 @@ The <paramref name="nonce" /> parameter length is not 12 bytes (96 bits).
238239
-or-
239240

240241
The <paramref name="tag" /> parameter length is not 16 bytes (128 bits).</exception>
241-
<exception cref="T:System.Security.Cryptography.CryptographicException">The tag value could not be verified, or the decryption operation otherwise failed.</exception>
242+
<exception cref="T:System.Security.Cryptography.CryptographicException">The decryption operation failed. Prior to .NET 8, indicates the tag value could not be verified.</exception>
243+
<exception cref="T:System.Security.Cryptography.AuthenticationTagMismatchException">.NET 8 and later versions: the tag value could not be verified.</exception>
242244
</Docs>
243245
</Member>
244246
<Member MemberName="Dispose">

xml/System.Security.Cryptography/IncrementalHash.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,7 @@
449449
</Parameters>
450450
<Docs>
451451
<param name="hashAlgorithm">The name of the hash algorithm to perform within the HMAC.</param>
452-
<param name="key">
453-
The secret key for the HMAC. The key can be any length, but a key longer than the output size
454-
of the hash algorithm specified by <paramref name="hashAlgorithm" /> will be hashed (using the
455-
algorithm specified by <paramref name="hashAlgorithm" />) to derive a correctly-sized key. Therefore,
456-
the recommended size of the secret key is the output size of the hash specified by
457-
<paramref name="hashAlgorithm" />.
458-
</param>
452+
<param name="key">The secret key for the HMAC.</param>
459453
<summary>
460454
Create an <see cref="T:System.Security.Cryptography.IncrementalHash" /> for the Hash-based Message Authentication Code (HMAC)
461455
algorithm utilizing the hash algorithm specified by <paramref name="hashAlgorithm" />, and a
@@ -513,7 +507,7 @@
513507
</Parameters>
514508
<Docs>
515509
<param name="hashAlgorithm">The name of the hash algorithm to perform within the HMAC.</param>
516-
<param name="key">The secret key for the HMAC. The key can be any length, but a key longer than the output size of the hash algorithm specified by <paramref name="hashAlgorithm" /> will be hashed (using the algorithm specified by <paramref name="hashAlgorithm" />) to derive a correctly-sized key. Therefore, the recommended size of the secret key is the output size of the hash specified by <paramref name="hashAlgorithm" />.</param>
510+
<param name="key">The secret key for the HMAC.</param>
517511
<summary>Create an <see cref="T:System.Security.Cryptography.IncrementalHash" /> for the Hash-based Message Authentication Code (HMAC) algorithm utilizing the hash algorithm specified by <paramref name="hashAlgorithm" />, and a key specified by <paramref name="key" />.</summary>
518512
<returns>A hash instance to compute the hash algorithm specified by <paramref name="hashAlgorithm" />.</returns>
519513
<remarks>To be added.</remarks>

0 commit comments

Comments
 (0)