Skip to content

Implement ValueAsnReader#125254

Merged
vcsjones merged 5 commits intodotnet:mainfrom
vcsjones:valueasnreader
Mar 7, 2026
Merged

Implement ValueAsnReader#125254
vcsjones merged 5 commits intodotnet:mainfrom
vcsjones:valueasnreader

Conversation

@vcsjones
Copy link
Member

@vcsjones vcsjones commented Mar 6, 2026

This implements ValueAsnReader, and replaces the old internal AsnValueReader with the new public one in some places.

This is not meant to be a comprehensive replacement of AsnValueReader yet, as that makes this pull request even more significant.

This pull request is broken up in to two commits: the new ValueAsnReader in the System.Formats.Asn1 package along with the tests, and the second commit is using it in asn.xslt, and updating all files as required that use the Asn-suffixed types.

We can split this pull request in to two separate PRs if preferred. However I wanted to see some real usage of the new APIs in functional unit tests of other areas to help validate the shape / implementation.

Fully removing the internal AsnValueReader will be a follow up pull request.

Closes #109019.

vcsjones and others added 2 commits March 5, 2026 22:13
Implements the approved API from dotnet#109019. ValueAsnReader is a
ref struct counterpart to AsnReader that operates on ReadOnlySpan<byte>
instead of ReadOnlyMemory<byte>.

Also adds comprehensive dual-testing via AsnReaderWrapper so all reader
tests exercise both AsnReader and ValueAsnReader.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 6, 2026 03:20
@vcsjones vcsjones added this to the 11.0.0 milestone Mar 6, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the new public ValueAsnReader in System.Formats.Asn1 (span-based, stateful ASN.1 reader) and updates several cryptography/X.509/PKCS components to use it in place of the internal AsnValueReader, with accompanying test refactoring to exercise both reader implementations.

Changes:

  • Add ValueAsnReader APIs (e.g., ReadSequence, ReadSetOf, ReadUtcTime, ReadObjectIdentifier, etc.) in System.Formats.Asn1.
  • Refactor System.Formats.Asn1 reader tests to run against both AsnReader and ValueAsnReader via a wrapper.
  • Replace usages of internal AsnValueReader with ValueAsnReader across X509/PKCS/Common crypto codepaths and generated ASN.1 decoders.

Reviewed changes

Copilot reviewed 173 out of 173 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/libraries/System.Security.Cryptography/tests/X509Certificates/NameTests.cs Switch tests to ValueAsnReader.
src/libraries/System.Security.Cryptography/tests/X509Certificates/ExportTests.cs Switch test ASN parsing to ValueAsnReader.
src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/CertificateRequestLoadTests.cs Switch test comparisons to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509SubjectAlternativeNameExtension.cs Use ValueAsnReader for SAN decode.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509Pal.macOS.cs Use ValueAsnReader for content-type detection.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509KeyUsageExtension.cs Use ValueAsnReader for key usage decode.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.macOS.cs Use ValueAsnReader in DER validation.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.iOS.cs Use ValueAsnReader in DER validation.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.Unix.cs Use ValueAsnReader for PKCS#12 sniffing.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.Android.cs Use ValueAsnReader in DER validation.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509Certificate2.cs Use ValueAsnReader in multi-valued RDN hostname matching.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509AuthorityKeyIdentifierExtension.cs Use ValueAsnReader in AKI decode.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509AuthorityInformationAccessExtension.cs Use ValueAsnReader in AIA decode.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X500RelativeDistinguishedName.cs Use ValueAsnReader for RDN parsing and asserts.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X500DistinguishedName.cs Use ValueAsnReader for DN parsing and bounds checks.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X500DirectoryStringHelper.cs Update helper overload to take ref ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/PublicKey.cs Use ValueAsnReader in SPKI decode path.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslX509ChainProcessor.cs Use ValueAsnReader for AIA parsing.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslCrlCache.cs Use ValueAsnReader for CRL distribution points parsing.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/CertificateRevocationListBuilder.cs Update decode helpers/struct to use ref ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/CertificateRevocationListBuilder.Load.cs Use ValueAsnReader for CRL load parsing.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/CertificateRequest.Load.cs Use ValueAsnReader for CSR parsing.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/CertificatePolicy.cs Use ValueAsnReader for extension parsing helpers.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/CertificateData.ManagedDecode.cs Use ValueAsnReader for cert decode and name parsing.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/ValidityAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/TimeAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/TbsCertificateAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/PolicyInformationAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/PolicyConstraintsAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/DistributionPointNameAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/DistributionPointAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/CertificationRequestInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/CertificationRequestAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/CertificateTemplateAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/CertificatePolicyMappingAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/CertificateAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/BasicConstraintsAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/AccessDescriptionAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/AppleCertificatePal.ImportExport.iOS.cs Use ValueAsnReader in PKCS sniffing.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/AndroidCertificatePal.cs Use ValueAsnReader in managed decode path.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Helpers.cs Use ValueAsnReader in DER validation helper.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.Managed.cs Use ValueAsnReader in ASN formatter.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/SignedCms.cs Use ValueAsnReader for content copying.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampToken.cs Use ValueAsnReader for token decode.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Rfc3161TimestampRequest.cs Use ValueAsnReader for request/response decode.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SigningCertificateV2Asn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SigningCertificateAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/SignedAttributesSet.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/Rfc3161TstInfo.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/Rfc3161TimeStampResp.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/Rfc3161TimeStampReq.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/Rfc3161Accuracy.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/RecipientKeyIdentifier.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/RecipientInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/RecipientIdentifierAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/RecipientEncryptedKeyAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/PolicyQualifierInfo.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/PolicyInformation.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/PkiStatusInfo.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/OtherKeyAttributeAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/OriginatorPublicKeyAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/OriginatorInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/OriginatorIdentifierOrKeyAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/MessageImprint.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/KeyTransRecipientInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/KeyAgreeRecipientInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/KeyAgreeRecipientIdentifierAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/EssCertIdV2.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/EssCertId.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/EnvelopedDataAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/Asn1/CadesIssuerSerial.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.cs Use ValueAsnReader for extension parsing.
src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.Decode.cs Use ValueAsnReader for content decoding.
src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.Asn.cs Use ValueAsnReader for message type OID read.
src/libraries/System.Formats.Asn1/tests/Writer/ComprehensiveWriteTest.cs Fix alias to new ReadNamedBitListBase shape.
src/libraries/System.Formats.Asn1/tests/System.Formats.Asn1.Tests.csproj Add new test helper sources to compilation.
src/libraries/System.Formats.Asn1/tests/Reader/ReadT61String.cs Split tests to run for class reader + value reader via base class.
src/libraries/System.Formats.Asn1/tests/Reader/AsnReaderWrapper.cs New wrapper enabling shared tests for both reader flavors.
src/libraries/System.Formats.Asn1/tests/Reader/AssertHelpers.cs New Assert.Throws helpers compatible with ref wrapper usage.
src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.UtcTime.cs Add ValueAsnReader.ReadUtcTime overloads.
src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.SetOf.cs Add ValueAsnReader.ReadSetOf overloads.
src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Sequence.cs Add ValueAsnReader.ReadSequence.
src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs Add ValueAsnReader.ReadObjectIdentifier.
src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Null.cs Add ValueAsnReader.ReadNull.
src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.GeneralizedTime.cs Add ValueAsnReader.ReadGeneralizedTime.
src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Boolean.cs Add ValueAsnReader.ReadBoolean.
src/libraries/Common/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.Pkcs12.cs Use ValueAsnReader in PKCS#12 loader.
src/libraries/Common/src/System/Security/Cryptography/RSAKeyFormatHelper.cs Use ValueAsnReader for DER size probing.
src/libraries/Common/src/System/Security/Cryptography/Pkcs/Pkcs8PrivateKeyInfo.cs Use ValueAsnReader for BER decode front-end.
src/libraries/Common/src/System/Security/Cryptography/Pkcs/Pkcs12SafeContents.cs Use ValueAsnReader for bag parsing.
src/libraries/Common/src/System/Security/Cryptography/Pkcs/Pkcs12Info.cs Use ValueAsnReader for authSafe traversal.
src/libraries/Common/src/System/Security/Cryptography/Oids.Shared.cs Update OID fast-path helpers to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/MLDsa.cs Use ValueAsnReader in SPKI import path.
src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.cs Use ValueAsnReader for SPKI/PKCS#8 parsing.
src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.Encrypted.cs Use ValueAsnReader in encrypted PKCS#8 parsing/validation.
src/libraries/Common/src/System/Security/Cryptography/AsymmetricAlgorithmHelpers.Der.cs Use ValueAsnReader in DER signature conversion.
src/libraries/Common/src/System/Security/Cryptography/Asn1/X509ExtensionAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/SubjectPublicKeyInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/SpecifiedECDomain.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Rc2CbcParameters.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/RSAPublicKeyAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/RSAPrivateKeyAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/PssParamsAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/PrivateKeyInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/SignerInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/SignerIdentifierAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/SignedDataAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/OtherCertificateFormat.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/IssuerAndSerialNumberAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/EncryptedDataAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/EncryptedContentInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/EncapsulatedContentInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/ContentInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs7/CertificateChoiceAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/SecretBagAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/SafeBagAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/PfxAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/MacData.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/CertBagAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pbkdf2SaltChoice.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/Pbkdf2Params.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/PBES2Params.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/PBEParameter.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/OtherNameAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/OaepParamsAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/NameConstraintsAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/MLKemPrivateKeyBothAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/MLKemPrivateKeyAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/MLDsaPrivateKeyBothAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/MLDsaPrivateKeyAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/GeneralSubtreeAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/GeneralNameAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/FieldID.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/EncryptedPrivateKeyInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/EdiPartyNameAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/ECPrivateKey.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/ECDomainParameters.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/DssParms.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/DirectoryStringAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/DigestInfoAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/CurveAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/AttributeAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/System/Security/Cryptography/Asn1/AlgorithmIdentifierAsn.xml.cs Generated decoder updated to ValueAsnReader.
src/libraries/Common/src/Internal/Cryptography/PkcsHelpers.cs Use ValueAsnReader for attribute normalization decode.
Comments suppressed due to low confidence (1)

src/libraries/System.Formats.Asn1/tests/Reader/AssertHelpers.cs:52

  • Same nullability issue as above: exception is non-nullable but assigned null. This will trigger nullable warnings; declare it as Exception? and keep the switch handling.

You can also share your feedback on Copilot code review. Take the survey.

Copilot AI review requested due to automatic review settings March 6, 2026 16:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 173 out of 173 changed files in this pull request and generated no new comments.


You can also share your feedback on Copilot code review. Take the survey.

Copy link
Member

@bartonjs bartonjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing some newlines, otherwise LGTM.

@vcsjones vcsjones enabled auto-merge (squash) March 6, 2026 19:48
@vcsjones vcsjones merged commit c290dc1 into dotnet:main Mar 7, 2026
86 of 90 checks passed
@vcsjones vcsjones deleted the valueasnreader branch March 7, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: System.Formats.Asn1.AsnValueReader

3 participants