[API Proposal]: OID mapping to PQC Algorithms
Author: vcsjonesCreated Sep 1, 2026Updated Oct 1, 2026
Labelsapi-suggestionarea-System.Security
Background and motivation
For PQC parameter sets we introduced types like MLKemAlgorithm, MLDsaAlgorithm, etc to identify the parameter set of the algorithm, as well as some useful properties for the parameter set like encapsulation key sizes, signature sizes, etc.
Parameter sets also have an OID assigned to them - these OIDs are used in AlgorithmIdentifiers for things like SPKI, PKCS#8, or CMS. These OIDs already exist on the parameter set, they just aren't publicly exposed. Exposing them publicly will allow for easier use in other assemblies like S.S.C.Pkcs or 3rd parties that want to build on top of the abstract classes.
API Proposal
FromOid and TryFromOid are existing names on HashAlgorithmName.
namespace System.Security.Cryptography;
public sealed partial class MLKemAlgorithm {
public Oid Oid { get; }
public static MLKemAlgorithm FromOid(string oid);
public static bool TryFromOid(string oid, [NotNullWhen(true)] out MLKemAlgorithm? algorithm);
}
public sealed partial class MLDsaAlgorithm {
public Oid Oid { get; }
public static MLDsaAlgorithm FromOid(string oid);
public static bool TryFromOid(string oid, [NotNullWhen(true)] out MLDsaAlgorithm? algorithm);
}
public sealed partial class SlhDsaAlgorithm {
public Oid Oid { get; }
public static SlhDsaAlgorithm FromOid(string oid);
public static bool TryFromOid(string oid, [NotNullWhen(true)] out SlhDsaAlgorithm? algorithm);
}
public sealed partial class CompositeMLKemAlgorithm {
public Oid Oid { get; }
public static CompositeMLKemAlgorithm FromOid(string oid);
public static bool TryFromOid(string oid, [NotNullWhen(true)] out CompositeMLKemAlgorithm? algorithm);
}
public sealed partial class CompositeMLDsaAlgorithm {
public Oid Oid { get; }
public static CompositeMLDsaAlgorithm FromOid(string oid);
public static bool TryFromOid(string oid, [NotNullWhen(true)] out CompositeMLDsaAlgorithm? algorithm);
}API Usage
EnvelopedCms cms = new EnvelopedCms();
cms.Decode(encodedMessage);
KemRecipientInfo recipientInfo = cms.RecipientInfos.OfType<KemRecipientInfo>().Single();
MLKemAlgorithm alg = MLKemAlgorithm.FromOid(recipientInfo.KeyEncapsulationAlgorithm.Oid.Value);Alternative Designs
No response
Risks
No response
Source: dotnet/runtime