Skip to content

Add UrlFormat to PQC Experimental attribute #115412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace System.Security.Cryptography
/// The derived classes are intended for interop with the underlying system
/// cryptographic libraries.
/// </remarks>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public abstract partial class MLDsa : IDisposable
#if DESIGNTIMEINTERFACES
#pragma warning disable SA1001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace System.Security.Cryptography
/// <summary>
/// Represents a specific algorithm within the ML-DSA family.
/// </summary>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public sealed class MLDsaAlgorithm
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace System.Security.Cryptography
{
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
internal sealed partial class MLDsaImplementation : MLDsa
{
private MLDsaImplementation(MLDsaAlgorithm algorithm)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace System.Security.Cryptography
/// cryptographic libraries.
/// </para>
/// </remarks>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public abstract class MLKem : IDisposable
{
private static readonly string[] s_knownOids = [Oids.MlKem512, Oids.MlKem768, Oids.MlKem1024];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace System.Security.Cryptography
/// </summary>
/// <seealso cref="MLKem" />
[DebuggerDisplay("{Name,nq}")]
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public sealed class MLKemAlgorithm : IEquatable<MLKemAlgorithm>
{
private MLKemAlgorithm(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace System.Security.Cryptography
/// The derived classes are intended for interop with the underlying system
/// cryptographic libraries.
/// </remarks>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public abstract partial class SlhDsa : IDisposable
#if DESIGNTIMEINTERFACES
#pragma warning disable SA1001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace System.Security.Cryptography
/// Represents a specific algorithm within the SHL-DSA family.
/// </summary>
[DebuggerDisplay("{Name,nq}")]
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public sealed class SlhDsaAlgorithm
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace System.Security.Cryptography
{
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
internal sealed partial class SlhDsaImplementation : SlhDsa
{
internal static partial bool SupportsAny();
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace System.Security.Cryptography
/// cryptographic libraries.
/// </para>
/// </remarks>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public sealed partial class MLDsaOpenSsl : MLDsa
{
private SafeEvpPKeyHandle _key;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace System.Security.Cryptography
/// cryptographic libraries.
/// </para>
/// </remarks>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public sealed partial class MLKemOpenSsl : MLKem
{
private readonly SafeEvpPKeyHandle _key;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace System.Security.Cryptography
/// cryptographic libraries.
/// </para>
/// </remarks>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public sealed partial class SlhDsaOpenSsl : SlhDsa
{
private readonly SafeEvpPKeyHandle _key;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public CertificateRequest(
/// <exception cref="ArgumentNullException">
/// <paramref name="subjectName" /> or <paramref name="key" /> is <see langword="null" />.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public CertificateRequest(
string subjectName,
MLDsa key)
Expand Down Expand Up @@ -220,7 +220,7 @@ public CertificateRequest(
/// <exception cref="ArgumentNullException">
/// <paramref name="subjectName" /> or <paramref name="key" /> is <see langword="null" />.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public CertificateRequest(
X500DistinguishedName subjectName,
MLDsa key)
Expand Down Expand Up @@ -248,7 +248,7 @@ public CertificateRequest(
/// <exception cref="ArgumentNullException">
/// <paramref name="subjectName" /> or <paramref name="key" /> is <see langword="null" />.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public CertificateRequest(
string subjectName,
SlhDsa key)
Expand Down Expand Up @@ -276,7 +276,7 @@ public CertificateRequest(
/// <exception cref="ArgumentNullException">
/// <paramref name="subjectName" /> or <paramref name="key" /> is <see langword="null" />.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public CertificateRequest(
X500DistinguishedName subjectName,
SlhDsa key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public PublicKey(AsymmetricAlgorithm key) : this(key.ExportSubjectPublicKeyInfo(
/// <see cref="MLKem.ExportSubjectPublicKeyInfo" /> must return a
/// valid ASN.1-DER encoded X.509 SubjectPublicKeyInfo.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public PublicKey(MLKem key) : this(key.ExportSubjectPublicKeyInfo())
{
}
Expand All @@ -86,7 +86,7 @@ public PublicKey(MLKem key) : this(key.ExportSubjectPublicKeyInfo())
/// <see cref="SlhDsa.ExportSubjectPublicKeyInfo" /> must return a
/// valid ASN.1-DER encoded X.509 SubjectPublicKeyInfo.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public PublicKey(SlhDsa key) : this(key.ExportSubjectPublicKeyInfo())
{
}
Expand Down Expand Up @@ -324,7 +324,7 @@ public static PublicKey CreateFromSubjectPublicKeyInfo(ReadOnlySpan<byte> source
/// <exception cref="CryptographicException">
/// The key contents are corrupt or could not be read successfully.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
[UnsupportedOSPlatform("browser")]
public MLKem? GetMLKemPublicKey()
{
Expand All @@ -347,7 +347,7 @@ public static PublicKey CreateFromSubjectPublicKeyInfo(ReadOnlySpan<byte> source
/// <exception cref="CryptographicException">
/// The key contents are corrupt or could not be read successfully.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
[UnsupportedOSPlatform("browser")]
public MLDsa? GetMLDsaPublicKey()
{
Expand All @@ -370,7 +370,7 @@ public static PublicKey CreateFromSubjectPublicKeyInfo(ReadOnlySpan<byte> source
/// <exception cref="CryptographicException">
/// The key contents are corrupt or could not be read successfully.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
[UnsupportedOSPlatform("browser")]
public SlhDsa? GetSlhDsaPublicKey() =>
Helpers.IsSlhDsaOid(_oid.Value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ public X509Certificate2 CopyWithPrivateKey(ECDiffieHellman privateKey)
/// <exception cref="CryptographicException">
/// The public key was invalid, or otherwise could not be imported.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public MLKem? GetMLKemPublicKey()
{
if (MLKemAlgorithm.FromOid(GetKeyAlgorithm()) is null)
Expand All @@ -812,7 +812,7 @@ public X509Certificate2 CopyWithPrivateKey(ECDiffieHellman privateKey)
/// <exception cref="CryptographicException">
/// An error occurred accessing the private key.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public MLKem? GetMLKemPrivateKey()
{
MLKemAlgorithm? algorithm = MLKemAlgorithm.FromOid(GetKeyAlgorithm());
Expand Down Expand Up @@ -845,7 +845,7 @@ public X509Certificate2 CopyWithPrivateKey(ECDiffieHellman privateKey)
/// <exception cref="InvalidOperationException">
/// The certificate already has an associated private key.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public X509Certificate2 CopyWithPrivateKey(MLKem privateKey)
{
ArgumentNullException.ThrowIfNull(privateKey);
Expand Down Expand Up @@ -890,7 +890,7 @@ public X509Certificate2 CopyWithPrivateKey(MLKem privateKey)
/// <exception cref="CryptographicException">
/// The public key was invalid, or otherwise could not be imported.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public MLDsa? GetMLDsaPublicKey()
{
MLDsaAlgorithm? algorithm = MLDsaAlgorithm.GetMLDsaAlgorithmFromOid(GetKeyAlgorithm());
Expand All @@ -913,7 +913,7 @@ public X509Certificate2 CopyWithPrivateKey(MLKem privateKey)
/// <exception cref="CryptographicException">
/// An error occurred accessing the private key.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public MLDsa? GetMLDsaPrivateKey()
{
MLDsaAlgorithm? algorithm = MLDsaAlgorithm.GetMLDsaAlgorithmFromOid(GetKeyAlgorithm());
Expand Down Expand Up @@ -946,7 +946,7 @@ public X509Certificate2 CopyWithPrivateKey(MLKem privateKey)
/// <exception cref="InvalidOperationException">
/// The certificate already has an associated private key.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public X509Certificate2 CopyWithPrivateKey(MLDsa privateKey)
{
ArgumentNullException.ThrowIfNull(privateKey);
Expand Down Expand Up @@ -994,7 +994,7 @@ public X509Certificate2 CopyWithPrivateKey(MLDsa privateKey)
/// <exception cref="CryptographicException">
/// The public key was invalid, or otherwise could not be imported.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public SlhDsa? GetSlhDsaPublicKey()
{
if (!Helpers.IsSlhDsaOid(GetKeyAlgorithm()))
Expand All @@ -1015,7 +1015,7 @@ public X509Certificate2 CopyWithPrivateKey(MLDsa privateKey)
/// <exception cref="CryptographicException">
/// An error occurred accessing the private key.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public SlhDsa? GetSlhDsaPrivateKey() =>
Helpers.IsSlhDsaOid(GetKeyAlgorithm())
? Pal.GetSlhDsaPrivateKey()
Expand All @@ -1041,7 +1041,7 @@ public X509Certificate2 CopyWithPrivateKey(MLDsa privateKey)
/// <exception cref="InvalidOperationException">
/// The certificate already has an associated private key.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public X509Certificate2 CopyWithPrivateKey(SlhDsa privateKey)
{
ArgumentNullException.ThrowIfNull(privateKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static X509SignatureGenerator CreateForRSA(RSA key, RSASignaturePadding s
/// <exception cref="ArgumentNullException">
/// <paramref name="key" /> is <see langword="null" />.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public static X509SignatureGenerator CreateForMLDsa(MLDsa key)
{
ArgumentNullException.ThrowIfNull(key);
Expand All @@ -67,7 +67,7 @@ public static X509SignatureGenerator CreateForMLDsa(MLDsa key)
/// <exception cref="ArgumentNullException">
/// <paramref name="key" /> is <see langword="null" />.
/// </exception>
[Experimental(Experimentals.PostQuantumCryptographyDiagId)]
[Experimental(Experimentals.PostQuantumCryptographyDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
public static X509SignatureGenerator CreateForSlhDsa(SlhDsa key)
{
ArgumentNullException.ThrowIfNull(key);
Expand Down
Loading