Skip to content

Commit 683da33

Browse files
authored
Merge pull request #46673 from dotnet/main
Merge main into live
2 parents 4687ef8 + fef25bc commit 683da33

File tree

7 files changed

+208
-56
lines changed

7 files changed

+208
-56
lines changed

docs/ai/tutorials/tutorial-ai-vector-search.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ When you run the app for the first time, it connects to Azure Cosmos DB and repo
7474
var jsonString= System.IO.File.ReadAllText(f);
7575
Recipe recipe = JsonConvert.DeserializeObject<Recipe>(jsonString);
7676
recipe.id = recipe.name.ToLower().Replace(" ", "");
77-
ret.Add(recipe);
77+
recipes.Add(recipe);
7878
}
7979
);
8080

docs/core/whats-new/dotnet-10/libraries.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22
title: What's new in .NET libraries for .NET 10
33
description: Learn about the updates to the .NET libraries for .NET 10.
44
titleSuffix: ""
5-
ms.date: 05/15/2025
5+
ms.date: 06/09/2025
66
ms.topic: whats-new
77
ai-usage: ai-assisted
88
---
99

1010
# What's new in .NET libraries for .NET 10
1111

12-
This article describes new features in the .NET libraries for .NET 10. It's updated for Preview 4.
12+
This article describes new features in the .NET libraries for .NET 10. It's updated for Preview 5.
1313

1414
## Cryptography
1515

1616
- [Find certificates by thumbprints other than SHA-1](#find-certificates-by-thumbprints-other-than-sha-1)
1717
- [Find PEM-encoded data in ASCII/UTF-8](#find-pem-encoded-data-in-asciiutf-8)
1818
- [Encryption algorithm for PKCS#12/PFX export](#encryption-algorithm-for-pkcs12pfx-export)
19+
- [Post-quantum cryptography (PQC)](#post-quantum-cryptography-pqc)
1920

2021
### Find certificates by thumbprints other than SHA-1
2122

@@ -56,11 +57,50 @@ The new <xref:System.Security.Cryptography.X509Certificates.X509Certificate.Expo
5657

5758
If you want even more control, you can use [the overload](xref:System.Security.Cryptography.X509Certificates.X509Certificate.ExportPkcs12(System.Security.Cryptography.PbeParameters,System.String)) that accepts a <xref:System.Security.Cryptography.PbeParameters>.
5859

60+
### Post-quantum cryptography (PQC)
61+
62+
.NET 10 includes support for three new asymmetric algorithms: ML-KEM (FIPS 202), ML-DSA (FIPS 203), and SLH-DSA (FIPS 204). The new types are:
63+
64+
- `System.Security.Cryptography.MLKem` <!--xref:System.Security.Cryptography.MLKem-->
65+
- `System.Security.Cryptography.MLDsa` <!--xref:System.Security.Cryptography.MLDsa-->
66+
- `System.Security.Cryptography.SlhDsa` <!--xref:System.Security.Cryptography.SlhDsa-->
67+
68+
Because it adds little benefit, these new types don't derive from <xref:System.Security.Cryptography.AsymmetricAlgorithm>. Rather than the `AsymmetricAlgorithm` approach of creating an object and then importing a key into it, or generating a fresh key, the new types all use static methods to generate or import a key:
69+
70+
```csharp
71+
using System;
72+
using System.IO;
73+
using System.Security.Cryptography;
74+
75+
private static bool ValidateMLDsaSignature(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, string publicKeyPath)
76+
{
77+
string publicKeyPem = File.ReadAllText(publicKeyPath);
78+
79+
using (MLDsa key = MLDsa.ImportFromPem(publicKeyPem))
80+
{
81+
return key.VerifyData(data, signature);
82+
}
83+
}
84+
```
85+
86+
And rather than setting object properties and having a key materialize, key generation on these new types takes in all of the options it needs.
87+
88+
```csharp
89+
using (MLKem key = MLKem.GenerateKey(MLKemAlgorithm.MLKem768))
90+
{
91+
string publicKeyPem = key.ExportSubjectPublicKeyInfoPem();
92+
...
93+
}
94+
```
95+
96+
These algorithms all continue with the pattern of having a static `IsSupported` property to indicate if the algorithm is supported on the current system.
97+
98+
Currently, the PQC algorithms are only available on systems where the system cryptographic libraries are OpenSSL 3.5 (or newer). Windows CNG support will be added soon. Also, the new classes are all marked as [`[Experimental]`](../../../fundamentals/syslib-diagnostics/experimental-overview.md) under diagnostic `SYSLIB5006` until development is complete.
99+
59100
## Globalization and date/time
60101

61102
- [New method overloads in ISOWeek for DateOnly type](#new-method-overloads-in-isoweek-for-dateonly-type)
62103
- [Numeric ordering for string comparison](#numeric-ordering-for-string-comparison)
63-
64104
- [New `TimeSpan.FromMilliseconds` overload with single parameter](#new-timespanfrommilliseconds-overload-with-single-parameter)
65105

66106
### New method overloads in ISOWeek for DateOnly type

docs/core/whats-new/dotnet-10/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
title: What's new in .NET 10
33
description: Learn about the new features introduced in .NET 10 for the runtime, libraries, and SDK. Also find links to what's new in other areas, such as ASP.NET Core.
44
titleSuffix: ""
5-
ms.date: 05/15/2025
5+
ms.date: 06/09/2025
66
ms.topic: whats-new
77
ai-usage: ai-assisted
88
---
99

1010
# What's new in .NET 10
1111

12-
Learn about the new features in .NET 10 and find links to further documentation. This page is updated for Preview 4.
12+
Learn about the new features in .NET 10 and find links to further documentation. This page is updated for Preview 5.
1313

1414
.NET 10, the successor to [.NET 9](../dotnet-9/overview.md), is [supported for three years](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) as a long-term support (LTS) release. You can [download .NET 10 here](https://get.dot.net/10).
1515

0 commit comments

Comments
 (0)