Restructure WellKnownOids.cs - #84921

Merged
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19
May 17, 2023
Merged

Restructure WellKnownOids.cs#84921
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19

Conversation

@am11

@am11am11 commented Apr 17, 2023

Copy link
Copy Markdown
Member

By moving private static ROS to local ROS variable and changing switch expression to switch-case syntax, we save 7.3 KB in NativeAOT app.

It removes System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 largest shared framework methods list:

$ ./build.sh clr+libs+packs -c Release -p:IlcGenerateMapFile=true
$ xmlstarlet sel -t -m "//ObjectNodes/MethodCode" -v 'concat(@Length, ": ", @Name)' -n artifacts/obj/coreclr/crossgen2/arm64/Release/native/crossgen2.map.xml |\
sort -nr | head -10 | grep -E ': (System|S_P)_'| xml unescape

@am11am11 added size-reduction Issues impacting final app size primary for size sensitive workloads area-System.Formats.Asn1 and removed area-System.Formats.Asn1 labels Apr 17, 2023
"2.23.140.1.2.1" => CabForumDV,
"2.23.140.1.2.2" => CabForumOV,
_ => ReadOnlySpan<byte>.Empty,
case "1.2.840.10040.4.1": return DSA;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about you inline the new byte[]s?

@stephentoub

stephentoub commented Apr 17, 2023

Copy link
Copy Markdown
Member

It's fine to switch to using local or inline spans, but I'm not a big fan of changing the switch syntax in the name of saving a few bytes based on how it's currently lowered by the C# compiler. What's the impact of just the syntax change? I'd expect it to just be the difference between N stores into a local and one return vs N returns.

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

Reverted the switch-case change.

@stephentoub

Copy link
Copy Markdown
Member

Can you instead structure it like:

returnvalueswitch{"1.2.840.10040.4.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,},// DSA"1.2.840.10040.4.3"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,},// DSAWithSha1"1.2.840.10045.2.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,},// EC"1.2.840.10045.1.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,},// EcPrimeField"1.2.840.10045.1.2"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,},// EcChar2Field"1.2.840.10045.3.1.7"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,},// Secp256r1
...

?

@EgorBo

Copy link
Copy Markdown
Member

Part of the problem (I've checked the current impl in this PR) is:

Inlines into System.Formats.Asn1.WellKnownOids:GetContents(System.ReadOnlySpan`1[ushort]):System.ReadOnlySpan`1[ubyte]:
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:get_Empty():System.ReadOnlySpan`1[ubyte]

JIT blows up from the number of temp locals, perhaps you can split it into two functions?

@stephentoub

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

@EgorBo

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

Looks like it makes it even worse (more locals), presumably, because Roslyn spills it anyway.
We either need to bump the limit of locals JIT can track or/and I also need to limit "string.Equals" unrolling optimization when we have too many locals already

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

UPD: looks like it's not Span/String.Equals's fault

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

I'm trying another approach by having one local and slicing.

I opened this PR by making change in browser, while my local HEAD was a few days old. Though it still saves 7+ K compared to main, it's no longer dropping System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 list, see the PR description. Looks like some recent change in JIT..

@EgorBo

Copy link
Copy Markdown
Member

Ok, I've bumped the "number of locals JIT can track" limit and it removed all not-inlined methods (all of them are now inlined) and reduced total size of the method in half

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

Looks like some recent change in JIT..

@am11 I think it's either #84530 or #83945

@jeffhandley

Copy link
Copy Markdown
Member

Tagging @dotnet/area-system-formats-asn1 since msftbot was down when the label was applied

Comment on lines +299 to +300
"1.3.132.0.35" => data.Slice(666, 5), // Secp521r1
"2.5.4.3" => data.Slice(671, 3), // CommonName

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a little bothered by how this will make future insertions hard to maintain in the same style. Right now, everything is sorted by the dotted decimal string (or the binary encoding, since they sort the same way). So, if in the future 2.5.4.2 is determined to be common enough to be worth encoding in the table, someone will have to decide between a) putting the new value at the end of the unified blob (being the first unsorted entry) or b) adding 3 to lines 300-321.

That said, adding things to this should be rare; so the savings might pay for the future frustration.

@adamsitnikadamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That said, adding things to this should be rare; so the savings might pay for the future frustration.

I agree with @bartonjs

I wrote a simple console app to verify that the change is not introducing any bug:

Details
namespaceWellKnownTests{internalclassProgram{staticvoidMain(string[]args){Test("1.2.840.10040.4.1");Test("1.2.840.10040.4.3");Test("1.2.840.10045.2.1");Test("1.2.840.10045.1.1");Test("1.2.840.10045.1.2");Test("1.2.840.10045.3.1.7");Test("1.2.840.10045.4.1");Test("1.2.840.10045.4.3.2");Test("1.2.840.10045.4.3.3");Test("1.2.840.10045.4.3.4");Test("1.2.840.113549.1.1.1");Test("1.2.840.113549.1.1.5");Test("1.2.840.113549.1.1.7");Test("1.2.840.113549.1.1.8");Test("1.2.840.113549.1.1.9");Test("1.2.840.113549.1.1.10");Test("1.2.840.113549.1.1.11");Test("1.2.840.113549.1.1.12");Test("1.2.840.113549.1.1.13");Test("1.2.840.113549.1.5.3");Test("1.2.840.113549.1.5.10");Test("1.2.840.113549.1.5.11");Test("1.2.840.113549.1.5.12");Test("1.2.840.113549.1.5.13");Test("1.2.840.113549.1.7.1");Test("1.2.840.113549.1.7.2");Test("1.2.840.113549.1.7.3");Test("1.2.840.113549.1.7.6");Test("1.2.840.113549.1.9.1");Test("1.2.840.113549.1.9.3");Test("1.2.840.113549.1.9.4");Test("1.2.840.113549.1.9.5");Test("1.2.840.113549.1.9.6");Test("1.2.840.113549.1.9.7");Test("1.2.840.113549.1.9.14");Test("1.2.840.113549.1.9.15");Test("1.2.840.113549.1.9.16.1.4");Test("1.2.840.113549.1.9.16.2.12");Test("1.2.840.113549.1.9.16.2.14");Test("1.2.840.113549.1.9.16.2.47");Test("1.2.840.113549.1.9.20");Test("1.2.840.113549.1.9.21");Test("1.2.840.113549.1.9.22.1");Test("1.2.840.113549.1.12.1.3");Test("1.2.840.113549.1.12.1.5");Test("1.2.840.113549.1.12.1.6");Test("1.2.840.113549.1.12.10.1.1");Test("1.2.840.113549.1.12.10.1.2");Test("1.2.840.113549.1.12.10.1.3");Test("1.2.840.113549.1.12.10.1.5");Test("1.2.840.113549.1.12.10.1.6");Test("1.2.840.113549.2.5");Test("1.2.840.113549.2.7");Test("1.2.840.113549.2.9");Test("1.2.840.113549.2.10");Test("1.2.840.113549.2.11");Test("1.2.840.113549.3.2");Test("1.2.840.113549.3.7");Test("1.3.6.1.4.1.311.17.1");Test("1.3.6.1.4.1.311.17.3.20");Test("1.3.6.1.4.1.311.20.2.3");Test("1.3.6.1.4.1.311.88.2.1");Test("1.3.6.1.4.1.311.88.2.2");Test("1.3.6.1.5.5.7.3.1");Test("1.3.6.1.5.5.7.3.2");Test("1.3.6.1.5.5.7.3.3");Test("1.3.6.1.5.5.7.3.4");Test("1.3.6.1.5.5.7.3.8");Test("1.3.6.1.5.5.7.3.9");Test("1.3.6.1.5.5.7.6.2");Test("1.3.6.1.5.5.7.48.1");Test("1.3.6.1.5.5.7.48.1.2");Test("1.3.6.1.5.5.7.48.2");Test("1.3.14.3.2.26");Test("1.3.14.3.2.7");Test("1.3.132.0.34");Test("1.3.132.0.35");Test("2.5.4.3");Test("2.5.4.5");Test("2.5.4.6");Test("2.5.4.7");Test("2.5.4.8");Test("2.5.4.10");Test("2.5.4.11");Test("2.5.4.97");Test("2.5.29.14");Test("2.5.29.15");Test("2.5.29.17");Test("2.5.29.19");Test("2.5.29.20");Test("2.5.29.35");Test("2.16.840.1.101.3.4.1.2");Test("2.16.840.1.101.3.4.1.22");Test("2.16.840.1.101.3.4.1.42");Test("2.16.840.1.101.3.4.2.1");Test("2.16.840.1.101.3.4.2.2");Test("2.16.840.1.101.3.4.2.3");Test("2.23.140.1.2.1");Test("2.23.140.1.2.2");staticvoidTest(stringvalue){ReadOnlySpan<byte>mainContents=WellKnownOids_Main.GetContents(value);ReadOnlySpan<byte>prContents=WellKnownOids_PR.GetContents(value);if(!mainContents.SequenceEqual(prContents)){thrownewException($"GetContents Bug for {value}");}string?mainValue=WellKnownOids_Main.GetValue(mainContents);string?prValue=WellKnownOids_PR.GetValue(prContents);if(prValue!=mainValue){thrownewException($"GetValue Bug for {value}");}}}}internalstaticclassWellKnownOids_Main{privatestaticReadOnlySpan<byte>DSA=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,};privatestaticReadOnlySpan<byte>DSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,};privatestaticReadOnlySpan<byte>EC=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,};privatestaticReadOnlySpan<byte>EcPrimeField=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,};privatestaticReadOnlySpan<byte>EcChar2Field=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,};privatestaticReadOnlySpan<byte>Secp256r1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,};privatestaticReadOnlySpan<byte>ECDSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,};privatestaticReadOnlySpan<byte>ECDSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,};privatestaticReadOnlySpan<byte>ECDSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,};privatestaticReadOnlySpan<byte>ECDSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,};privatestaticReadOnlySpan<byte>RSA=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,};privatestaticReadOnlySpan<byte>RSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,};privatestaticReadOnlySpan<byte>RSAOAEP=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,};privatestaticReadOnlySpan<byte>MGF1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,};privatestaticReadOnlySpan<byte>OaepPSpecified=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,};privatestaticReadOnlySpan<byte>RSAPSS=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,};privatestaticReadOnlySpan<byte>RSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,};privatestaticReadOnlySpan<byte>RSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,};privatestaticReadOnlySpan<byte>RSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,};privatestaticReadOnlySpan<byte>PbeWithMD5AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,};privatestaticReadOnlySpan<byte>PbeWithSha1AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,};privatestaticReadOnlySpan<byte>PbeWithSha1AndRC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,};privatestaticReadOnlySpan<byte>Pbkdf2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,};privatestaticReadOnlySpan<byte>PasswordBasedEncryptionScheme2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,};privatestaticReadOnlySpan<byte>Pkcs7Data=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,};privatestaticReadOnlySpan<byte>Pkcs7SignedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,};privatestaticReadOnlySpan<byte>Pkcs7EnvelopedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,};privatestaticReadOnlySpan<byte>Pkcs7EncryptedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,};privatestaticReadOnlySpan<byte>Pkcs9EmailAddress=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,};privatestaticReadOnlySpan<byte>Pkcs9ContentType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,};privatestaticReadOnlySpan<byte>Pkcs9MessageDigest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,};privatestaticReadOnlySpan<byte>Pkcs9SigningTime=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,};privatestaticReadOnlySpan<byte>Pkcs9CounterSigner=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,};privatestaticReadOnlySpan<byte>Pkcs9Challenge=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,};privatestaticReadOnlySpan<byte>Pkcs9ExtensionRequest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,};privatestaticReadOnlySpan<byte>Pkcs9SMimeCapabilities=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,};privatestaticReadOnlySpan<byte>TstInfo=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,};privatestaticReadOnlySpan<byte>SigningCertificateAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,};privatestaticReadOnlySpan<byte>SignatureTimeStampAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,};privatestaticReadOnlySpan<byte>SigningCertificateV2Attr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,};privatestaticReadOnlySpan<byte>Pkcs9FriendlyName=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,};privatestaticReadOnlySpan<byte>LocalKeyId=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,};privatestaticReadOnlySpan<byte>Pkcs12X509CertType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,};privatestaticReadOnlySpan<byte>Pkcs12TripleDes=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc128=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc40=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,};privatestaticReadOnlySpan<byte>Pkcs12KeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,};privatestaticReadOnlySpan<byte>Pkcs12ShroudedKeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,};privatestaticReadOnlySpan<byte>Pkcs12CertBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12SecretBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12SafeContentsBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,};privatestaticReadOnlySpan<byte>MD5=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,};privatestaticReadOnlySpan<byte>HMACSHA1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,};privatestaticReadOnlySpan<byte>HMACSHA256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,};privatestaticReadOnlySpan<byte>HMACSHA384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,};privatestaticReadOnlySpan<byte>HMACSHA512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,};privatestaticReadOnlySpan<byte>RC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,};privatestaticReadOnlySpan<byte>TripleDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,};privatestaticReadOnlySpan<byte>Pkcs12KeyProviderName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,};privatestaticReadOnlySpan<byte>KeyIdentifier=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,};privatestaticReadOnlySpan<byte>UserPrincipalName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,};privatestaticReadOnlySpan<byte>DocumentNameAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,};privatestaticReadOnlySpan<byte>DocumentDescriptionAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeTlsServer=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,};privatestaticReadOnlySpan<byte>KeyPurposeTlsClient=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeCodeSign=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,};privatestaticReadOnlySpan<byte>KeyPurposeEmailProtection=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,};privatestaticReadOnlySpan<byte>KeyPurposeTimestamping=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,};privatestaticReadOnlySpan<byte>KeyPurposeOcspSigner=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,};privatestaticReadOnlySpan<byte>Pkcs7NoSignature=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,};privatestaticReadOnlySpan<byte>OCSP=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,};privatestaticReadOnlySpan<byte>OcspNonce=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,};privatestaticReadOnlySpan<byte>CAIssuers=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,};privatestaticReadOnlySpan<byte>SHA1=>newbyte[]{0x2B,0x0E,0x03,0x02,0x1A,};privatestaticReadOnlySpan<byte>DES=>newbyte[]{0x2B,0x0E,0x03,0x02,0x07,};privatestaticReadOnlySpan<byte>Secp384r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x22,};privatestaticReadOnlySpan<byte>Secp521r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x23,};privatestaticReadOnlySpan<byte>CommonName=>newbyte[]{0x55,0x04,0x03,};privatestaticReadOnlySpan<byte>SerialNumber=>newbyte[]{0x55,0x04,0x05,};privatestaticReadOnlySpan<byte>CountryOrRegionName=>newbyte[]{0x55,0x04,0x06,};privatestaticReadOnlySpan<byte>Locality=>newbyte[]{0x55,0x04,0x07,};privatestaticReadOnlySpan<byte>StateOrProvinceName=>newbyte[]{0x55,0x04,0x08,};privatestaticReadOnlySpan<byte>OrganizationName=>newbyte[]{0x55,0x04,0x0A,};privatestaticReadOnlySpan<byte>OrganizationalUnit=>newbyte[]{0x55,0x04,0x0B,};privatestaticReadOnlySpan<byte>OrganizationIdentifier=>newbyte[]{0x55,0x04,0x61,};privatestaticReadOnlySpan<byte>SubjectKeyIdentifier=>newbyte[]{0x55,0x1D,0x0E,};privatestaticReadOnlySpan<byte>KeyUsage=>newbyte[]{0x55,0x1D,0x0F,};privatestaticReadOnlySpan<byte>SubjectAlternativeName=>newbyte[]{0x55,0x1D,0x11,};privatestaticReadOnlySpan<byte>BasicConstraints=>newbyte[]{0x55,0x1D,0x13,};privatestaticReadOnlySpan<byte>CrlNumber=>newbyte[]{0x55,0x1D,0x14,};privatestaticReadOnlySpan<byte>AuthorityKeyIdentifier=>newbyte[]{0x55,0x1D,0x23,};privatestaticReadOnlySpan<byte>Aes128Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,};privatestaticReadOnlySpan<byte>Aes192Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,};privatestaticReadOnlySpan<byte>Aes256Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,};privatestaticReadOnlySpan<byte>Sha256=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,};privatestaticReadOnlySpan<byte>Sha384=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,};privatestaticReadOnlySpan<byte>Sha512=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,};privatestaticReadOnlySpan<byte>CabForumDV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x01,};privatestaticReadOnlySpan<byte>CabForumOV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x02,};internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){returnvalueswitch{"1.2.840.10040.4.1"=>DSA,"1.2.840.10040.4.3"=>DSAWithSha1,"1.2.840.10045.2.1"=>EC,"1.2.840.10045.1.1"=>EcPrimeField,"1.2.840.10045.1.2"=>EcChar2Field,"1.2.840.10045.3.1.7"=>Secp256r1,"1.2.840.10045.4.1"=>ECDSAWithSha1,"1.2.840.10045.4.3.2"=>ECDSAWithSha256,"1.2.840.10045.4.3.3"=>ECDSAWithSha384,"1.2.840.10045.4.3.4"=>ECDSAWithSha512,"1.2.840.113549.1.1.1"=>RSA,"1.2.840.113549.1.1.5"=>RSAWithSha1,"1.2.840.113549.1.1.7"=>RSAOAEP,"1.2.840.113549.1.1.8"=>MGF1,"1.2.840.113549.1.1.9"=>OaepPSpecified,"1.2.840.113549.1.1.10"=>RSAPSS,"1.2.840.113549.1.1.11"=>RSAWithSha256,"1.2.840.113549.1.1.12"=>RSAWithSha384,"1.2.840.113549.1.1.13"=>RSAWithSha512,"1.2.840.113549.1.5.3"=>PbeWithMD5AndDESCBC,"1.2.840.113549.1.5.10"=>PbeWithSha1AndDESCBC,"1.2.840.113549.1.5.11"=>PbeWithSha1AndRC2CBC,"1.2.840.113549.1.5.12"=>Pbkdf2,"1.2.840.113549.1.5.13"=>PasswordBasedEncryptionScheme2,"1.2.840.113549.1.7.1"=>Pkcs7Data,"1.2.840.113549.1.7.2"=>Pkcs7SignedData,"1.2.840.113549.1.7.3"=>Pkcs7EnvelopedData,"1.2.840.113549.1.7.6"=>Pkcs7EncryptedData,"1.2.840.113549.1.9.1"=>Pkcs9EmailAddress,"1.2.840.113549.1.9.3"=>Pkcs9ContentType,"1.2.840.113549.1.9.4"=>Pkcs9MessageDigest,"1.2.840.113549.1.9.5"=>Pkcs9SigningTime,"1.2.840.113549.1.9.6"=>Pkcs9CounterSigner,"1.2.840.113549.1.9.7"=>Pkcs9Challenge,"1.2.840.113549.1.9.14"=>Pkcs9ExtensionRequest,"1.2.840.113549.1.9.15"=>Pkcs9SMimeCapabilities,"1.2.840.113549.1.9.16.1.4"=>TstInfo,"1.2.840.113549.1.9.16.2.12"=>SigningCertificateAttr,"1.2.840.113549.1.9.16.2.14"=>SignatureTimeStampAttr,"1.2.840.113549.1.9.16.2.47"=>SigningCertificateV2Attr,"1.2.840.113549.1.9.20"=>Pkcs9FriendlyName,"1.2.840.113549.1.9.21"=>LocalKeyId,"1.2.840.113549.1.9.22.1"=>Pkcs12X509CertType,"1.2.840.113549.1.12.1.3"=>Pkcs12TripleDes,"1.2.840.113549.1.12.1.5"=>Pkcs12Rc2Cbc128,"1.2.840.113549.1.12.1.6"=>Pkcs12Rc2Cbc40,"1.2.840.113549.1.12.10.1.1"=>Pkcs12KeyBag,"1.2.840.113549.1.12.10.1.2"=>Pkcs12ShroudedKeyBag,"1.2.840.113549.1.12.10.1.3"=>Pkcs12CertBag,"1.2.840.113549.1.12.10.1.5"=>Pkcs12SecretBag,"1.2.840.113549.1.12.10.1.6"=>Pkcs12SafeContentsBag,"1.2.840.113549.2.5"=>MD5,"1.2.840.113549.2.7"=>HMACSHA1,"1.2.840.113549.2.9"=>HMACSHA256,"1.2.840.113549.2.10"=>HMACSHA384,"1.2.840.113549.2.11"=>HMACSHA512,"1.2.840.113549.3.2"=>RC2CBC,"1.2.840.113549.3.7"=>TripleDESCBC,"1.3.6.1.4.1.311.17.1"=>Pkcs12KeyProviderName,"1.3.6.1.4.1.311.17.3.20"=>KeyIdentifier,"1.3.6.1.4.1.311.20.2.3"=>UserPrincipalName,"1.3.6.1.4.1.311.88.2.1"=>DocumentNameAttr,"1.3.6.1.4.1.311.88.2.2"=>DocumentDescriptionAttr,"1.3.6.1.5.5.7.3.1"=>KeyPurposeTlsServer,"1.3.6.1.5.5.7.3.2"=>KeyPurposeTlsClient,"1.3.6.1.5.5.7.3.3"=>KeyPurposeCodeSign,"1.3.6.1.5.5.7.3.4"=>KeyPurposeEmailProtection,"1.3.6.1.5.5.7.3.8"=>KeyPurposeTimestamping,"1.3.6.1.5.5.7.3.9"=>KeyPurposeOcspSigner,"1.3.6.1.5.5.7.6.2"=>Pkcs7NoSignature,"1.3.6.1.5.5.7.48.1"=>OCSP,"1.3.6.1.5.5.7.48.1.2"=>OcspNonce,"1.3.6.1.5.5.7.48.2"=>CAIssuers,"1.3.14.3.2.26"=>SHA1,"1.3.14.3.2.7"=>DES,"1.3.132.0.34"=>Secp384r1,"1.3.132.0.35"=>Secp521r1,"2.5.4.3"=>CommonName,"2.5.4.5"=>SerialNumber,"2.5.4.6"=>CountryOrRegionName,"2.5.4.7"=>Locality,"2.5.4.8"=>StateOrProvinceName,"2.5.4.10"=>OrganizationName,"2.5.4.11"=>OrganizationalUnit,"2.5.4.97"=>OrganizationIdentifier,"2.5.29.14"=>SubjectKeyIdentifier,"2.5.29.15"=>KeyUsage,"2.5.29.17"=>SubjectAlternativeName,"2.5.29.19"=>BasicConstraints,"2.5.29.20"=>CrlNumber,"2.5.29.35"=>AuthorityKeyIdentifier,"2.16.840.1.101.3.4.1.2"=>Aes128Cbc,"2.16.840.1.101.3.4.1.22"=>Aes192Cbc,"2.16.840.1.101.3.4.1.42"=>Aes256Cbc,"2.16.840.1.101.3.4.2.1"=>Sha256,"2.16.840.1.101.3.4.2.2"=>Sha384,"2.16.840.1.101.3.4.2.3"=>Sha512,"2.23.140.1.2.1"=>CabForumDV,"2.23.140.1.2.2"=>CabForumOV,
_ =>ReadOnlySpan<byte>.Empty,};}}internalstaticclassWellKnownOids_PR{internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){ReadOnlySpan<byte>data=newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,// DSA0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,// DSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,// EC0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,// EcPrimeField0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,// EcChar2Field0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,// Secp256r10x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,// ECDSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,// ECDSAWithSha2560x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,// ECDSAWithSha3840x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,// ECDSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,// RSA0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,// RSAWithSha10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,// RSAOAEP0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,// MGF10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,// OaepPSpecified0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,// RSAPSS0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,// RSAWithSha2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,// RSAWithSha3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,// RSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,// PbeWithMD5AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,// PbeWithSha1AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,// PbeWithSha1AndRC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,// Pbkdf20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,// PasswordBasedEncryptionScheme20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,// Pkcs7Data0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,// Pkcs7SignedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,// Pkcs7EnvelopedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,// Pkcs7EncryptedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,// Pkcs9EmailAddress0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,// Pkcs9ContentType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,// Pkcs9MessageDigest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,// Pkcs9SigningTime0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,// Pkcs9CounterSigner0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,// Pkcs9Challenge0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,// Pkcs9ExtensionRequest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,// Pkcs9SMimeCapabilities0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,// TstInfo0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,// SigningCertificateAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,// SignatureTimeStampAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,// SigningCertificateV2Attr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,// Pkcs9FriendlyName0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,// LocalKeyId0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,// Pkcs12X509CertType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,// Pkcs12TripleDes0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,// Pkcs12Rc2Cbc1280x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,// Pkcs12Rc2Cbc400x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,// Pkcs12KeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,// Pkcs12ShroudedKeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,// Pkcs12CertBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,// Pkcs12SecretBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,// Pkcs12SafeContentsBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,// MD50x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,// HMACSHA10x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,// HMACSHA2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,// HMACSHA3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,// HMACSHA5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,// RC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,// TripleDESCBC0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,// Pkcs12KeyProviderName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,// KeyIdentifier0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,// UserPrincipalName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,// DocumentNameAttr0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,// DocumentDescriptionAttr0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,// KeyPurposeTlsServer0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,// KeyPurposeTlsClient0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,// KeyPurposeCodeSign0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,// KeyPurposeEmailProtection0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,// KeyPurposeTimestamping0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,// KeyPurposeOcspSigner0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,// Pkcs7NoSignature0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,// OCSP0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,// OcspNonce0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,// CAIssuers0x2B,0x0E,0x03,0x02,0x1A,// SHA10x2B,0x0E,0x03,0x02,0x07,// DES0x2B,0x81,0x04,0x00,0x22,// Secp384r10x2B,0x81,0x04,0x00,0x23,// Secp521r10x55,0x04,0x03,// CommonName0x55,0x04,0x05,// SerialNumber0x55,0x04,0x06,// CountryOrRegionName0x55,0x04,0x07,// Locality0x55,0x04,0x08,// StateOrProvinceName0x55,0x04,0x0A,// OrganizationName0x55,0x04,0x0B,// OrganizationalUnit0x55,0x04,0x61,// OrganizationIdentifier0x55,0x1D,0x0E,// SubjectKeyIdentifier0x55,0x1D,0x0F,// KeyUsage0x55,0x1D,0x11,// SubjectAlternativeName0x55,0x1D,0x13,// BasicConstraints0x55,0x1D,0x14,// CrlNumber0x55,0x1D,0x23,// AuthorityKeyIdentifier0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,// Aes128Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,// Aes192Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,// Aes256Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,// Sha2560x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,// Sha3840x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,// Sha5120x67,0x81,0x0C,0x01,0x02,0x01,// CabForumDV0x67,0x81,0x0C,0x01,0x02,0x02,// CabForumOV};returnvalueswitch{"1.2.840.10040.4.1"=>data.Slice(0,7),// DSA"1.2.840.10040.4.3"=>data.Slice(7,7),// DSAWithSha1"1.2.840.10045.2.1"=>data.Slice(14,7),// EC"1.2.840.10045.1.1"=>data.Slice(21,7),// EcPrimeField"1.2.840.10045.1.2"=>data.Slice(28,7),// EcChar2Field"1.2.840.10045.3.1.7"=>data.Slice(35,8),// Secp256r1"1.2.840.10045.4.1"=>data.Slice(43,7),// ECDSAWithSha1"1.2.840.10045.4.3.2"=>data.Slice(50,8),// ECDSAWithSha256"1.2.840.10045.4.3.3"=>data.Slice(58,8),// ECDSAWithSha384"1.2.840.10045.4.3.4"=>data.Slice(66,8),// ECDSAWithSha512"1.2.840.113549.1.1.1"=>data.Slice(74,9),// RSA"1.2.840.113549.1.1.5"=>data.Slice(83,9),// RSAWithSha1"1.2.840.113549.1.1.7"=>data.Slice(92,9),// RSAOAEP"1.2.840.113549.1.1.8"=>data.Slice(101,9),// MGF1"1.2.840.113549.1.1.9"=>data.Slice(110,9),// OaepPSpecified"1.2.840.113549.1.1.10"=>data.Slice(119,9),// RSAPSS"1.2.840.113549.1.1.11"=>data.Slice(128,9),// RSAWithSha256"1.2.840.113549.1.1.12"=>data.Slice(137,9),// RSAWithSha384"1.2.840.113549.1.1.13"=>data.Slice(146,9),// RSAWithSha512"1.2.840.113549.1.5.3"=>data.Slice(155,9),// PbeWithMD5AndDESCBC"1.2.840.113549.1.5.10"=>data.Slice(164,9),// PbeWithSha1AndDESCBC"1.2.840.113549.1.5.11"=>data.Slice(173,9),// PbeWithSha1AndRC2CBC"1.2.840.113549.1.5.12"=>data.Slice(182,9),// Pbkdf2"1.2.840.113549.1.5.13"=>data.Slice(191,9),// PasswordBasedEncryptionScheme2"1.2.840.113549.1.7.1"=>data.Slice(200,9),// Pkcs7Data"1.2.840.113549.1.7.2"=>data.Slice(209,9),// Pkcs7SignedData"1.2.840.113549.1.7.3"=>data.Slice(218,9),// Pkcs7EnvelopedData"1.2.840.113549.1.7.6"=>data.Slice(227,9),// Pkcs7EncryptedData"1.2.840.113549.1.9.1"=>data.Slice(236,9),// Pkcs9EmailAddress"1.2.840.113549.1.9.3"=>data.Slice(245,9),// Pkcs9ContentType"1.2.840.113549.1.9.4"=>data.Slice(254,9),// Pkcs9MessageDigest"1.2.840.113549.1.9.5"=>data.Slice(263,9),// Pkcs9SigningTime"1.2.840.113549.1.9.6"=>data.Slice(272,9),// Pkcs9CounterSigner"1.2.840.113549.1.9.7"=>data.Slice(281,9),// Pkcs9Challenge"1.2.840.113549.1.9.14"=>data.Slice(290,9),// Pkcs9ExtensionRequest"1.2.840.113549.1.9.15"=>data.Slice(299,9),// Pkcs9SMimeCapabilities"1.2.840.113549.1.9.16.1.4"=>data.Slice(308,11),// TstInfo"1.2.840.113549.1.9.16.2.12"=>data.Slice(319,11),// SigningCertificateAttr"1.2.840.113549.1.9.16.2.14"=>data.Slice(330,11),// SignatureTimeStampAttr"1.2.840.113549.1.9.16.2.47"=>data.Slice(341,11),// SigningCertificateV2Attr"1.2.840.113549.1.9.20"=>data.Slice(352,9),// Pkcs9FriendlyName"1.2.840.113549.1.9.21"=>data.Slice(361,9),// LocalKeyId"1.2.840.113549.1.9.22.1"=>data.Slice(370,10),// Pkcs12X509CertType"1.2.840.113549.1.12.1.3"=>data.Slice(380,10),// Pkcs12TripleDes"1.2.840.113549.1.12.1.5"=>data.Slice(390,10),// Pkcs12Rc2Cbc128"1.2.840.113549.1.12.1.6"=>data.Slice(400,10),// Pkcs12Rc2Cbc40"1.2.840.113549.1.12.10.1.1"=>data.Slice(410,11),// Pkcs12KeyBag"1.2.840.113549.1.12.10.1.2"=>data.Slice(421,11),// Pkcs12ShroudedKeyBag"1.2.840.113549.1.12.10.1.3"=>data.Slice(432,11),// Pkcs12CertBag"1.2.840.113549.1.12.10.1.5"=>data.Slice(443,11),// Pkcs12SecretBag"1.2.840.113549.1.12.10.1.6"=>data.Slice(454,11),// Pkcs12SafeContentsBag"1.2.840.113549.2.5"=>data.Slice(465,8),// MD5"1.2.840.113549.2.7"=>data.Slice(473,8),// HMACSHA1"1.2.840.113549.2.9"=>data.Slice(481,8),// HMACSHA256"1.2.840.113549.2.10"=>data.Slice(489,8),// HMACSHA384"1.2.840.113549.2.11"=>data.Slice(497,8),// HMACSHA512"1.2.840.113549.3.2"=>data.Slice(505,8),// RC2CBC"1.2.840.113549.3.7"=>data.Slice(513,8),// TripleDESCBC"1.3.6.1.4.1.311.17.1"=>data.Slice(521,9),// Pkcs12KeyProviderName"1.3.6.1.4.1.311.17.3.20"=>data.Slice(530,10),// KeyIdentifier"1.3.6.1.4.1.311.20.2.3"=>data.Slice(540,10),// UserPrincipalName"1.3.6.1.4.1.311.88.2.1"=>data.Slice(550,10),// DocumentNameAttr"1.3.6.1.4.1.311.88.2.2"=>data.Slice(560,10),// DocumentDescriptionAttr"1.3.6.1.5.5.7.3.1"=>data.Slice(570,8),// KeyPurposeTlsServer"1.3.6.1.5.5.7.3.2"=>data.Slice(578,8),// KeyPurposeTlsClient"1.3.6.1.5.5.7.3.3"=>data.Slice(586,8),// KeyPurposeCodeSign"1.3.6.1.5.5.7.3.4"=>data.Slice(594,8),// KeyPurposeEmailProtection"1.3.6.1.5.5.7.3.8"=>data.Slice(602,8),// KeyPurposeTimestamping"1.3.6.1.5.5.7.3.9"=>data.Slice(610,8),// KeyPurposeOcspSigner"1.3.6.1.5.5.7.6.2"=>data.Slice(618,8),// Pkcs7NoSignature"1.3.6.1.5.5.7.48.1"=>data.Slice(626,8),// OCSP"1.3.6.1.5.5.7.48.1.2"=>data.Slice(634,9),// OcspNonce"1.3.6.1.5.5.7.48.2"=>data.Slice(643,8),// CAIssuers"1.3.14.3.2.26"=>data.Slice(651,5),// SHA1"1.3.14.3.2.7"=>data.Slice(656,5),// DES"1.3.132.0.34"=>data.Slice(661,5),// Secp384r1"1.3.132.0.35"=>data.Slice(666,5),// Secp521r1"2.5.4.3"=>data.Slice(671,3),// CommonName"2.5.4.5"=>data.Slice(674,3),// SerialNumber"2.5.4.6"=>data.Slice(677,3),// CountryOrRegionName"2.5.4.7"=>data.Slice(680,3),// Locality"2.5.4.8"=>data.Slice(683,3),// StateOrProvinceName"2.5.4.10"=>data.Slice(686,3),// OrganizationName"2.5.4.11"=>data.Slice(689,3),// OrganizationalUnit"2.5.4.97"=>data.Slice(692,3),// OrganizationIdentifier"2.5.29.14"=>data.Slice(695,3),// SubjectKeyIdentifier"2.5.29.15"=>data.Slice(698,3),// KeyUsage"2.5.29.17"=>data.Slice(701,3),// SubjectAlternativeName"2.5.29.19"=>data.Slice(704,3),// BasicConstraints"2.5.29.20"=>data.Slice(707,3),// CrlNumber"2.5.29.35"=>data.Slice(710,3),// AuthorityKeyIdentifier"2.16.840.1.101.3.4.1.2"=>data.Slice(713,9),// Aes128Cbc"2.16.840.1.101.3.4.1.22"=>data.Slice(722,9),// Aes192Cbc"2.16.840.1.101.3.4.1.42"=>data.Slice(731,9),// Aes256Cbc"2.16.840.1.101.3.4.2.1"=>data.Slice(740,9),// Sha256"2.16.840.1.101.3.4.2.2"=>data.Slice(749,9),// Sha384"2.16.840.1.101.3.4.2.3"=>data.Slice(758,9),// Sha512"2.23.140.1.2.1"=>data.Slice(767,6),// CabForumDV"2.23.140.1.2.2"=>data.Slice(773,6),// CabForumOV
_ =>ReadOnlySpan<byte>.Empty};}}}

Thank you for your contribution to size reduction @am11 !

@adamsitnikadamsitnik self-assigned this May 17, 2023
@adamsitnik
adamsitnik merged commit 976409d into dotnet:mainMay 17, 2023
@ghostghost locked as resolved and limited conversation to collaborators Jun 16, 2023
@am11
am11 deleted the patch-19 branch June 14, 2024 04:53
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Formats.Asn1size-reductionIssues impacting final app size primary for size sensitive workloads

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@am11@stephentoub@EgorBo@jeffhandley@adamsitnik@bartonjs@teo-tsirpanis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Restructure WellKnownOids.cs - #84921

Merged
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19
May 17, 2023
Merged

Restructure WellKnownOids.cs#84921
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19

Conversation

@am11

@am11am11 commented Apr 17, 2023

Copy link
Copy Markdown
Member

By moving private static ROS to local ROS variable and changing switch expression to switch-case syntax, we save 7.3 KB in NativeAOT app.

It removes System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 largest shared framework methods list:

$ ./build.sh clr+libs+packs -c Release -p:IlcGenerateMapFile=true
$ xmlstarlet sel -t -m "//ObjectNodes/MethodCode" -v 'concat(@Length, ": ", @Name)' -n artifacts/obj/coreclr/crossgen2/arm64/Release/native/crossgen2.map.xml |\
sort -nr | head -10 | grep -E ': (System|S_P)_'| xml unescape

@am11am11 added size-reduction Issues impacting final app size primary for size sensitive workloads area-System.Formats.Asn1 and removed area-System.Formats.Asn1 labels Apr 17, 2023
"2.23.140.1.2.1" => CabForumDV,
"2.23.140.1.2.2" => CabForumOV,
_ => ReadOnlySpan<byte>.Empty,
case "1.2.840.10040.4.1": return DSA;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about you inline the new byte[]s?

@stephentoub

stephentoub commented Apr 17, 2023

Copy link
Copy Markdown
Member

It's fine to switch to using local or inline spans, but I'm not a big fan of changing the switch syntax in the name of saving a few bytes based on how it's currently lowered by the C# compiler. What's the impact of just the syntax change? I'd expect it to just be the difference between N stores into a local and one return vs N returns.

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

Reverted the switch-case change.

@stephentoub

Copy link
Copy Markdown
Member

Can you instead structure it like:

returnvalueswitch{"1.2.840.10040.4.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,},// DSA"1.2.840.10040.4.3"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,},// DSAWithSha1"1.2.840.10045.2.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,},// EC"1.2.840.10045.1.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,},// EcPrimeField"1.2.840.10045.1.2"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,},// EcChar2Field"1.2.840.10045.3.1.7"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,},// Secp256r1
...

?

@EgorBo

Copy link
Copy Markdown
Member

Part of the problem (I've checked the current impl in this PR) is:

Inlines into System.Formats.Asn1.WellKnownOids:GetContents(System.ReadOnlySpan`1[ushort]):System.ReadOnlySpan`1[ubyte]:
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:get_Empty():System.ReadOnlySpan`1[ubyte]

JIT blows up from the number of temp locals, perhaps you can split it into two functions?

@stephentoub

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

@EgorBo

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

Looks like it makes it even worse (more locals), presumably, because Roslyn spills it anyway.
We either need to bump the limit of locals JIT can track or/and I also need to limit "string.Equals" unrolling optimization when we have too many locals already

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

UPD: looks like it's not Span/String.Equals's fault

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

I'm trying another approach by having one local and slicing.

I opened this PR by making change in browser, while my local HEAD was a few days old. Though it still saves 7+ K compared to main, it's no longer dropping System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 list, see the PR description. Looks like some recent change in JIT..

@EgorBo

Copy link
Copy Markdown
Member

Ok, I've bumped the "number of locals JIT can track" limit and it removed all not-inlined methods (all of them are now inlined) and reduced total size of the method in half

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

Looks like some recent change in JIT..

@am11 I think it's either #84530 or #83945

@jeffhandley

Copy link
Copy Markdown
Member

Tagging @dotnet/area-system-formats-asn1 since msftbot was down when the label was applied

Comment on lines +299 to +300
"1.3.132.0.35" => data.Slice(666, 5), // Secp521r1
"2.5.4.3" => data.Slice(671, 3), // CommonName

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a little bothered by how this will make future insertions hard to maintain in the same style. Right now, everything is sorted by the dotted decimal string (or the binary encoding, since they sort the same way). So, if in the future 2.5.4.2 is determined to be common enough to be worth encoding in the table, someone will have to decide between a) putting the new value at the end of the unified blob (being the first unsorted entry) or b) adding 3 to lines 300-321.

That said, adding things to this should be rare; so the savings might pay for the future frustration.

@adamsitnikadamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That said, adding things to this should be rare; so the savings might pay for the future frustration.

I agree with @bartonjs

I wrote a simple console app to verify that the change is not introducing any bug:

Details
namespaceWellKnownTests{internalclassProgram{staticvoidMain(string[]args){Test("1.2.840.10040.4.1");Test("1.2.840.10040.4.3");Test("1.2.840.10045.2.1");Test("1.2.840.10045.1.1");Test("1.2.840.10045.1.2");Test("1.2.840.10045.3.1.7");Test("1.2.840.10045.4.1");Test("1.2.840.10045.4.3.2");Test("1.2.840.10045.4.3.3");Test("1.2.840.10045.4.3.4");Test("1.2.840.113549.1.1.1");Test("1.2.840.113549.1.1.5");Test("1.2.840.113549.1.1.7");Test("1.2.840.113549.1.1.8");Test("1.2.840.113549.1.1.9");Test("1.2.840.113549.1.1.10");Test("1.2.840.113549.1.1.11");Test("1.2.840.113549.1.1.12");Test("1.2.840.113549.1.1.13");Test("1.2.840.113549.1.5.3");Test("1.2.840.113549.1.5.10");Test("1.2.840.113549.1.5.11");Test("1.2.840.113549.1.5.12");Test("1.2.840.113549.1.5.13");Test("1.2.840.113549.1.7.1");Test("1.2.840.113549.1.7.2");Test("1.2.840.113549.1.7.3");Test("1.2.840.113549.1.7.6");Test("1.2.840.113549.1.9.1");Test("1.2.840.113549.1.9.3");Test("1.2.840.113549.1.9.4");Test("1.2.840.113549.1.9.5");Test("1.2.840.113549.1.9.6");Test("1.2.840.113549.1.9.7");Test("1.2.840.113549.1.9.14");Test("1.2.840.113549.1.9.15");Test("1.2.840.113549.1.9.16.1.4");Test("1.2.840.113549.1.9.16.2.12");Test("1.2.840.113549.1.9.16.2.14");Test("1.2.840.113549.1.9.16.2.47");Test("1.2.840.113549.1.9.20");Test("1.2.840.113549.1.9.21");Test("1.2.840.113549.1.9.22.1");Test("1.2.840.113549.1.12.1.3");Test("1.2.840.113549.1.12.1.5");Test("1.2.840.113549.1.12.1.6");Test("1.2.840.113549.1.12.10.1.1");Test("1.2.840.113549.1.12.10.1.2");Test("1.2.840.113549.1.12.10.1.3");Test("1.2.840.113549.1.12.10.1.5");Test("1.2.840.113549.1.12.10.1.6");Test("1.2.840.113549.2.5");Test("1.2.840.113549.2.7");Test("1.2.840.113549.2.9");Test("1.2.840.113549.2.10");Test("1.2.840.113549.2.11");Test("1.2.840.113549.3.2");Test("1.2.840.113549.3.7");Test("1.3.6.1.4.1.311.17.1");Test("1.3.6.1.4.1.311.17.3.20");Test("1.3.6.1.4.1.311.20.2.3");Test("1.3.6.1.4.1.311.88.2.1");Test("1.3.6.1.4.1.311.88.2.2");Test("1.3.6.1.5.5.7.3.1");Test("1.3.6.1.5.5.7.3.2");Test("1.3.6.1.5.5.7.3.3");Test("1.3.6.1.5.5.7.3.4");Test("1.3.6.1.5.5.7.3.8");Test("1.3.6.1.5.5.7.3.9");Test("1.3.6.1.5.5.7.6.2");Test("1.3.6.1.5.5.7.48.1");Test("1.3.6.1.5.5.7.48.1.2");Test("1.3.6.1.5.5.7.48.2");Test("1.3.14.3.2.26");Test("1.3.14.3.2.7");Test("1.3.132.0.34");Test("1.3.132.0.35");Test("2.5.4.3");Test("2.5.4.5");Test("2.5.4.6");Test("2.5.4.7");Test("2.5.4.8");Test("2.5.4.10");Test("2.5.4.11");Test("2.5.4.97");Test("2.5.29.14");Test("2.5.29.15");Test("2.5.29.17");Test("2.5.29.19");Test("2.5.29.20");Test("2.5.29.35");Test("2.16.840.1.101.3.4.1.2");Test("2.16.840.1.101.3.4.1.22");Test("2.16.840.1.101.3.4.1.42");Test("2.16.840.1.101.3.4.2.1");Test("2.16.840.1.101.3.4.2.2");Test("2.16.840.1.101.3.4.2.3");Test("2.23.140.1.2.1");Test("2.23.140.1.2.2");staticvoidTest(stringvalue){ReadOnlySpan<byte>mainContents=WellKnownOids_Main.GetContents(value);ReadOnlySpan<byte>prContents=WellKnownOids_PR.GetContents(value);if(!mainContents.SequenceEqual(prContents)){thrownewException($"GetContents Bug for {value}");}string?mainValue=WellKnownOids_Main.GetValue(mainContents);string?prValue=WellKnownOids_PR.GetValue(prContents);if(prValue!=mainValue){thrownewException($"GetValue Bug for {value}");}}}}internalstaticclassWellKnownOids_Main{privatestaticReadOnlySpan<byte>DSA=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,};privatestaticReadOnlySpan<byte>DSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,};privatestaticReadOnlySpan<byte>EC=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,};privatestaticReadOnlySpan<byte>EcPrimeField=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,};privatestaticReadOnlySpan<byte>EcChar2Field=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,};privatestaticReadOnlySpan<byte>Secp256r1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,};privatestaticReadOnlySpan<byte>ECDSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,};privatestaticReadOnlySpan<byte>ECDSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,};privatestaticReadOnlySpan<byte>ECDSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,};privatestaticReadOnlySpan<byte>ECDSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,};privatestaticReadOnlySpan<byte>RSA=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,};privatestaticReadOnlySpan<byte>RSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,};privatestaticReadOnlySpan<byte>RSAOAEP=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,};privatestaticReadOnlySpan<byte>MGF1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,};privatestaticReadOnlySpan<byte>OaepPSpecified=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,};privatestaticReadOnlySpan<byte>RSAPSS=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,};privatestaticReadOnlySpan<byte>RSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,};privatestaticReadOnlySpan<byte>RSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,};privatestaticReadOnlySpan<byte>RSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,};privatestaticReadOnlySpan<byte>PbeWithMD5AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,};privatestaticReadOnlySpan<byte>PbeWithSha1AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,};privatestaticReadOnlySpan<byte>PbeWithSha1AndRC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,};privatestaticReadOnlySpan<byte>Pbkdf2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,};privatestaticReadOnlySpan<byte>PasswordBasedEncryptionScheme2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,};privatestaticReadOnlySpan<byte>Pkcs7Data=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,};privatestaticReadOnlySpan<byte>Pkcs7SignedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,};privatestaticReadOnlySpan<byte>Pkcs7EnvelopedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,};privatestaticReadOnlySpan<byte>Pkcs7EncryptedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,};privatestaticReadOnlySpan<byte>Pkcs9EmailAddress=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,};privatestaticReadOnlySpan<byte>Pkcs9ContentType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,};privatestaticReadOnlySpan<byte>Pkcs9MessageDigest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,};privatestaticReadOnlySpan<byte>Pkcs9SigningTime=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,};privatestaticReadOnlySpan<byte>Pkcs9CounterSigner=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,};privatestaticReadOnlySpan<byte>Pkcs9Challenge=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,};privatestaticReadOnlySpan<byte>Pkcs9ExtensionRequest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,};privatestaticReadOnlySpan<byte>Pkcs9SMimeCapabilities=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,};privatestaticReadOnlySpan<byte>TstInfo=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,};privatestaticReadOnlySpan<byte>SigningCertificateAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,};privatestaticReadOnlySpan<byte>SignatureTimeStampAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,};privatestaticReadOnlySpan<byte>SigningCertificateV2Attr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,};privatestaticReadOnlySpan<byte>Pkcs9FriendlyName=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,};privatestaticReadOnlySpan<byte>LocalKeyId=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,};privatestaticReadOnlySpan<byte>Pkcs12X509CertType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,};privatestaticReadOnlySpan<byte>Pkcs12TripleDes=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc128=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc40=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,};privatestaticReadOnlySpan<byte>Pkcs12KeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,};privatestaticReadOnlySpan<byte>Pkcs12ShroudedKeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,};privatestaticReadOnlySpan<byte>Pkcs12CertBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12SecretBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12SafeContentsBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,};privatestaticReadOnlySpan<byte>MD5=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,};privatestaticReadOnlySpan<byte>HMACSHA1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,};privatestaticReadOnlySpan<byte>HMACSHA256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,};privatestaticReadOnlySpan<byte>HMACSHA384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,};privatestaticReadOnlySpan<byte>HMACSHA512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,};privatestaticReadOnlySpan<byte>RC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,};privatestaticReadOnlySpan<byte>TripleDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,};privatestaticReadOnlySpan<byte>Pkcs12KeyProviderName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,};privatestaticReadOnlySpan<byte>KeyIdentifier=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,};privatestaticReadOnlySpan<byte>UserPrincipalName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,};privatestaticReadOnlySpan<byte>DocumentNameAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,};privatestaticReadOnlySpan<byte>DocumentDescriptionAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeTlsServer=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,};privatestaticReadOnlySpan<byte>KeyPurposeTlsClient=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeCodeSign=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,};privatestaticReadOnlySpan<byte>KeyPurposeEmailProtection=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,};privatestaticReadOnlySpan<byte>KeyPurposeTimestamping=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,};privatestaticReadOnlySpan<byte>KeyPurposeOcspSigner=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,};privatestaticReadOnlySpan<byte>Pkcs7NoSignature=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,};privatestaticReadOnlySpan<byte>OCSP=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,};privatestaticReadOnlySpan<byte>OcspNonce=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,};privatestaticReadOnlySpan<byte>CAIssuers=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,};privatestaticReadOnlySpan<byte>SHA1=>newbyte[]{0x2B,0x0E,0x03,0x02,0x1A,};privatestaticReadOnlySpan<byte>DES=>newbyte[]{0x2B,0x0E,0x03,0x02,0x07,};privatestaticReadOnlySpan<byte>Secp384r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x22,};privatestaticReadOnlySpan<byte>Secp521r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x23,};privatestaticReadOnlySpan<byte>CommonName=>newbyte[]{0x55,0x04,0x03,};privatestaticReadOnlySpan<byte>SerialNumber=>newbyte[]{0x55,0x04,0x05,};privatestaticReadOnlySpan<byte>CountryOrRegionName=>newbyte[]{0x55,0x04,0x06,};privatestaticReadOnlySpan<byte>Locality=>newbyte[]{0x55,0x04,0x07,};privatestaticReadOnlySpan<byte>StateOrProvinceName=>newbyte[]{0x55,0x04,0x08,};privatestaticReadOnlySpan<byte>OrganizationName=>newbyte[]{0x55,0x04,0x0A,};privatestaticReadOnlySpan<byte>OrganizationalUnit=>newbyte[]{0x55,0x04,0x0B,};privatestaticReadOnlySpan<byte>OrganizationIdentifier=>newbyte[]{0x55,0x04,0x61,};privatestaticReadOnlySpan<byte>SubjectKeyIdentifier=>newbyte[]{0x55,0x1D,0x0E,};privatestaticReadOnlySpan<byte>KeyUsage=>newbyte[]{0x55,0x1D,0x0F,};privatestaticReadOnlySpan<byte>SubjectAlternativeName=>newbyte[]{0x55,0x1D,0x11,};privatestaticReadOnlySpan<byte>BasicConstraints=>newbyte[]{0x55,0x1D,0x13,};privatestaticReadOnlySpan<byte>CrlNumber=>newbyte[]{0x55,0x1D,0x14,};privatestaticReadOnlySpan<byte>AuthorityKeyIdentifier=>newbyte[]{0x55,0x1D,0x23,};privatestaticReadOnlySpan<byte>Aes128Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,};privatestaticReadOnlySpan<byte>Aes192Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,};privatestaticReadOnlySpan<byte>Aes256Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,};privatestaticReadOnlySpan<byte>Sha256=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,};privatestaticReadOnlySpan<byte>Sha384=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,};privatestaticReadOnlySpan<byte>Sha512=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,};privatestaticReadOnlySpan<byte>CabForumDV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x01,};privatestaticReadOnlySpan<byte>CabForumOV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x02,};internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){returnvalueswitch{"1.2.840.10040.4.1"=>DSA,"1.2.840.10040.4.3"=>DSAWithSha1,"1.2.840.10045.2.1"=>EC,"1.2.840.10045.1.1"=>EcPrimeField,"1.2.840.10045.1.2"=>EcChar2Field,"1.2.840.10045.3.1.7"=>Secp256r1,"1.2.840.10045.4.1"=>ECDSAWithSha1,"1.2.840.10045.4.3.2"=>ECDSAWithSha256,"1.2.840.10045.4.3.3"=>ECDSAWithSha384,"1.2.840.10045.4.3.4"=>ECDSAWithSha512,"1.2.840.113549.1.1.1"=>RSA,"1.2.840.113549.1.1.5"=>RSAWithSha1,"1.2.840.113549.1.1.7"=>RSAOAEP,"1.2.840.113549.1.1.8"=>MGF1,"1.2.840.113549.1.1.9"=>OaepPSpecified,"1.2.840.113549.1.1.10"=>RSAPSS,"1.2.840.113549.1.1.11"=>RSAWithSha256,"1.2.840.113549.1.1.12"=>RSAWithSha384,"1.2.840.113549.1.1.13"=>RSAWithSha512,"1.2.840.113549.1.5.3"=>PbeWithMD5AndDESCBC,"1.2.840.113549.1.5.10"=>PbeWithSha1AndDESCBC,"1.2.840.113549.1.5.11"=>PbeWithSha1AndRC2CBC,"1.2.840.113549.1.5.12"=>Pbkdf2,"1.2.840.113549.1.5.13"=>PasswordBasedEncryptionScheme2,"1.2.840.113549.1.7.1"=>Pkcs7Data,"1.2.840.113549.1.7.2"=>Pkcs7SignedData,"1.2.840.113549.1.7.3"=>Pkcs7EnvelopedData,"1.2.840.113549.1.7.6"=>Pkcs7EncryptedData,"1.2.840.113549.1.9.1"=>Pkcs9EmailAddress,"1.2.840.113549.1.9.3"=>Pkcs9ContentType,"1.2.840.113549.1.9.4"=>Pkcs9MessageDigest,"1.2.840.113549.1.9.5"=>Pkcs9SigningTime,"1.2.840.113549.1.9.6"=>Pkcs9CounterSigner,"1.2.840.113549.1.9.7"=>Pkcs9Challenge,"1.2.840.113549.1.9.14"=>Pkcs9ExtensionRequest,"1.2.840.113549.1.9.15"=>Pkcs9SMimeCapabilities,"1.2.840.113549.1.9.16.1.4"=>TstInfo,"1.2.840.113549.1.9.16.2.12"=>SigningCertificateAttr,"1.2.840.113549.1.9.16.2.14"=>SignatureTimeStampAttr,"1.2.840.113549.1.9.16.2.47"=>SigningCertificateV2Attr,"1.2.840.113549.1.9.20"=>Pkcs9FriendlyName,"1.2.840.113549.1.9.21"=>LocalKeyId,"1.2.840.113549.1.9.22.1"=>Pkcs12X509CertType,"1.2.840.113549.1.12.1.3"=>Pkcs12TripleDes,"1.2.840.113549.1.12.1.5"=>Pkcs12Rc2Cbc128,"1.2.840.113549.1.12.1.6"=>Pkcs12Rc2Cbc40,"1.2.840.113549.1.12.10.1.1"=>Pkcs12KeyBag,"1.2.840.113549.1.12.10.1.2"=>Pkcs12ShroudedKeyBag,"1.2.840.113549.1.12.10.1.3"=>Pkcs12CertBag,"1.2.840.113549.1.12.10.1.5"=>Pkcs12SecretBag,"1.2.840.113549.1.12.10.1.6"=>Pkcs12SafeContentsBag,"1.2.840.113549.2.5"=>MD5,"1.2.840.113549.2.7"=>HMACSHA1,"1.2.840.113549.2.9"=>HMACSHA256,"1.2.840.113549.2.10"=>HMACSHA384,"1.2.840.113549.2.11"=>HMACSHA512,"1.2.840.113549.3.2"=>RC2CBC,"1.2.840.113549.3.7"=>TripleDESCBC,"1.3.6.1.4.1.311.17.1"=>Pkcs12KeyProviderName,"1.3.6.1.4.1.311.17.3.20"=>KeyIdentifier,"1.3.6.1.4.1.311.20.2.3"=>UserPrincipalName,"1.3.6.1.4.1.311.88.2.1"=>DocumentNameAttr,"1.3.6.1.4.1.311.88.2.2"=>DocumentDescriptionAttr,"1.3.6.1.5.5.7.3.1"=>KeyPurposeTlsServer,"1.3.6.1.5.5.7.3.2"=>KeyPurposeTlsClient,"1.3.6.1.5.5.7.3.3"=>KeyPurposeCodeSign,"1.3.6.1.5.5.7.3.4"=>KeyPurposeEmailProtection,"1.3.6.1.5.5.7.3.8"=>KeyPurposeTimestamping,"1.3.6.1.5.5.7.3.9"=>KeyPurposeOcspSigner,"1.3.6.1.5.5.7.6.2"=>Pkcs7NoSignature,"1.3.6.1.5.5.7.48.1"=>OCSP,"1.3.6.1.5.5.7.48.1.2"=>OcspNonce,"1.3.6.1.5.5.7.48.2"=>CAIssuers,"1.3.14.3.2.26"=>SHA1,"1.3.14.3.2.7"=>DES,"1.3.132.0.34"=>Secp384r1,"1.3.132.0.35"=>Secp521r1,"2.5.4.3"=>CommonName,"2.5.4.5"=>SerialNumber,"2.5.4.6"=>CountryOrRegionName,"2.5.4.7"=>Locality,"2.5.4.8"=>StateOrProvinceName,"2.5.4.10"=>OrganizationName,"2.5.4.11"=>OrganizationalUnit,"2.5.4.97"=>OrganizationIdentifier,"2.5.29.14"=>SubjectKeyIdentifier,"2.5.29.15"=>KeyUsage,"2.5.29.17"=>SubjectAlternativeName,"2.5.29.19"=>BasicConstraints,"2.5.29.20"=>CrlNumber,"2.5.29.35"=>AuthorityKeyIdentifier,"2.16.840.1.101.3.4.1.2"=>Aes128Cbc,"2.16.840.1.101.3.4.1.22"=>Aes192Cbc,"2.16.840.1.101.3.4.1.42"=>Aes256Cbc,"2.16.840.1.101.3.4.2.1"=>Sha256,"2.16.840.1.101.3.4.2.2"=>Sha384,"2.16.840.1.101.3.4.2.3"=>Sha512,"2.23.140.1.2.1"=>CabForumDV,"2.23.140.1.2.2"=>CabForumOV,
_ =>ReadOnlySpan<byte>.Empty,};}}internalstaticclassWellKnownOids_PR{internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){ReadOnlySpan<byte>data=newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,// DSA0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,// DSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,// EC0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,// EcPrimeField0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,// EcChar2Field0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,// Secp256r10x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,// ECDSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,// ECDSAWithSha2560x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,// ECDSAWithSha3840x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,// ECDSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,// RSA0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,// RSAWithSha10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,// RSAOAEP0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,// MGF10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,// OaepPSpecified0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,// RSAPSS0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,// RSAWithSha2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,// RSAWithSha3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,// RSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,// PbeWithMD5AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,// PbeWithSha1AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,// PbeWithSha1AndRC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,// Pbkdf20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,// PasswordBasedEncryptionScheme20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,// Pkcs7Data0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,// Pkcs7SignedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,// Pkcs7EnvelopedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,// Pkcs7EncryptedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,// Pkcs9EmailAddress0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,// Pkcs9ContentType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,// Pkcs9MessageDigest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,// Pkcs9SigningTime0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,// Pkcs9CounterSigner0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,// Pkcs9Challenge0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,// Pkcs9ExtensionRequest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,// Pkcs9SMimeCapabilities0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,// TstInfo0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,// SigningCertificateAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,// SignatureTimeStampAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,// SigningCertificateV2Attr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,// Pkcs9FriendlyName0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,// LocalKeyId0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,// Pkcs12X509CertType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,// Pkcs12TripleDes0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,// Pkcs12Rc2Cbc1280x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,// Pkcs12Rc2Cbc400x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,// Pkcs12KeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,// Pkcs12ShroudedKeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,// Pkcs12CertBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,// Pkcs12SecretBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,// Pkcs12SafeContentsBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,// MD50x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,// HMACSHA10x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,// HMACSHA2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,// HMACSHA3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,// HMACSHA5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,// RC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,// TripleDESCBC0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,// Pkcs12KeyProviderName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,// KeyIdentifier0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,// UserPrincipalName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,// DocumentNameAttr0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,// DocumentDescriptionAttr0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,// KeyPurposeTlsServer0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,// KeyPurposeTlsClient0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,// KeyPurposeCodeSign0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,// KeyPurposeEmailProtection0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,// KeyPurposeTimestamping0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,// KeyPurposeOcspSigner0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,// Pkcs7NoSignature0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,// OCSP0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,// OcspNonce0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,// CAIssuers0x2B,0x0E,0x03,0x02,0x1A,// SHA10x2B,0x0E,0x03,0x02,0x07,// DES0x2B,0x81,0x04,0x00,0x22,// Secp384r10x2B,0x81,0x04,0x00,0x23,// Secp521r10x55,0x04,0x03,// CommonName0x55,0x04,0x05,// SerialNumber0x55,0x04,0x06,// CountryOrRegionName0x55,0x04,0x07,// Locality0x55,0x04,0x08,// StateOrProvinceName0x55,0x04,0x0A,// OrganizationName0x55,0x04,0x0B,// OrganizationalUnit0x55,0x04,0x61,// OrganizationIdentifier0x55,0x1D,0x0E,// SubjectKeyIdentifier0x55,0x1D,0x0F,// KeyUsage0x55,0x1D,0x11,// SubjectAlternativeName0x55,0x1D,0x13,// BasicConstraints0x55,0x1D,0x14,// CrlNumber0x55,0x1D,0x23,// AuthorityKeyIdentifier0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,// Aes128Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,// Aes192Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,// Aes256Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,// Sha2560x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,// Sha3840x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,// Sha5120x67,0x81,0x0C,0x01,0x02,0x01,// CabForumDV0x67,0x81,0x0C,0x01,0x02,0x02,// CabForumOV};returnvalueswitch{"1.2.840.10040.4.1"=>data.Slice(0,7),// DSA"1.2.840.10040.4.3"=>data.Slice(7,7),// DSAWithSha1"1.2.840.10045.2.1"=>data.Slice(14,7),// EC"1.2.840.10045.1.1"=>data.Slice(21,7),// EcPrimeField"1.2.840.10045.1.2"=>data.Slice(28,7),// EcChar2Field"1.2.840.10045.3.1.7"=>data.Slice(35,8),// Secp256r1"1.2.840.10045.4.1"=>data.Slice(43,7),// ECDSAWithSha1"1.2.840.10045.4.3.2"=>data.Slice(50,8),// ECDSAWithSha256"1.2.840.10045.4.3.3"=>data.Slice(58,8),// ECDSAWithSha384"1.2.840.10045.4.3.4"=>data.Slice(66,8),// ECDSAWithSha512"1.2.840.113549.1.1.1"=>data.Slice(74,9),// RSA"1.2.840.113549.1.1.5"=>data.Slice(83,9),// RSAWithSha1"1.2.840.113549.1.1.7"=>data.Slice(92,9),// RSAOAEP"1.2.840.113549.1.1.8"=>data.Slice(101,9),// MGF1"1.2.840.113549.1.1.9"=>data.Slice(110,9),// OaepPSpecified"1.2.840.113549.1.1.10"=>data.Slice(119,9),// RSAPSS"1.2.840.113549.1.1.11"=>data.Slice(128,9),// RSAWithSha256"1.2.840.113549.1.1.12"=>data.Slice(137,9),// RSAWithSha384"1.2.840.113549.1.1.13"=>data.Slice(146,9),// RSAWithSha512"1.2.840.113549.1.5.3"=>data.Slice(155,9),// PbeWithMD5AndDESCBC"1.2.840.113549.1.5.10"=>data.Slice(164,9),// PbeWithSha1AndDESCBC"1.2.840.113549.1.5.11"=>data.Slice(173,9),// PbeWithSha1AndRC2CBC"1.2.840.113549.1.5.12"=>data.Slice(182,9),// Pbkdf2"1.2.840.113549.1.5.13"=>data.Slice(191,9),// PasswordBasedEncryptionScheme2"1.2.840.113549.1.7.1"=>data.Slice(200,9),// Pkcs7Data"1.2.840.113549.1.7.2"=>data.Slice(209,9),// Pkcs7SignedData"1.2.840.113549.1.7.3"=>data.Slice(218,9),// Pkcs7EnvelopedData"1.2.840.113549.1.7.6"=>data.Slice(227,9),// Pkcs7EncryptedData"1.2.840.113549.1.9.1"=>data.Slice(236,9),// Pkcs9EmailAddress"1.2.840.113549.1.9.3"=>data.Slice(245,9),// Pkcs9ContentType"1.2.840.113549.1.9.4"=>data.Slice(254,9),// Pkcs9MessageDigest"1.2.840.113549.1.9.5"=>data.Slice(263,9),// Pkcs9SigningTime"1.2.840.113549.1.9.6"=>data.Slice(272,9),// Pkcs9CounterSigner"1.2.840.113549.1.9.7"=>data.Slice(281,9),// Pkcs9Challenge"1.2.840.113549.1.9.14"=>data.Slice(290,9),// Pkcs9ExtensionRequest"1.2.840.113549.1.9.15"=>data.Slice(299,9),// Pkcs9SMimeCapabilities"1.2.840.113549.1.9.16.1.4"=>data.Slice(308,11),// TstInfo"1.2.840.113549.1.9.16.2.12"=>data.Slice(319,11),// SigningCertificateAttr"1.2.840.113549.1.9.16.2.14"=>data.Slice(330,11),// SignatureTimeStampAttr"1.2.840.113549.1.9.16.2.47"=>data.Slice(341,11),// SigningCertificateV2Attr"1.2.840.113549.1.9.20"=>data.Slice(352,9),// Pkcs9FriendlyName"1.2.840.113549.1.9.21"=>data.Slice(361,9),// LocalKeyId"1.2.840.113549.1.9.22.1"=>data.Slice(370,10),// Pkcs12X509CertType"1.2.840.113549.1.12.1.3"=>data.Slice(380,10),// Pkcs12TripleDes"1.2.840.113549.1.12.1.5"=>data.Slice(390,10),// Pkcs12Rc2Cbc128"1.2.840.113549.1.12.1.6"=>data.Slice(400,10),// Pkcs12Rc2Cbc40"1.2.840.113549.1.12.10.1.1"=>data.Slice(410,11),// Pkcs12KeyBag"1.2.840.113549.1.12.10.1.2"=>data.Slice(421,11),// Pkcs12ShroudedKeyBag"1.2.840.113549.1.12.10.1.3"=>data.Slice(432,11),// Pkcs12CertBag"1.2.840.113549.1.12.10.1.5"=>data.Slice(443,11),// Pkcs12SecretBag"1.2.840.113549.1.12.10.1.6"=>data.Slice(454,11),// Pkcs12SafeContentsBag"1.2.840.113549.2.5"=>data.Slice(465,8),// MD5"1.2.840.113549.2.7"=>data.Slice(473,8),// HMACSHA1"1.2.840.113549.2.9"=>data.Slice(481,8),// HMACSHA256"1.2.840.113549.2.10"=>data.Slice(489,8),// HMACSHA384"1.2.840.113549.2.11"=>data.Slice(497,8),// HMACSHA512"1.2.840.113549.3.2"=>data.Slice(505,8),// RC2CBC"1.2.840.113549.3.7"=>data.Slice(513,8),// TripleDESCBC"1.3.6.1.4.1.311.17.1"=>data.Slice(521,9),// Pkcs12KeyProviderName"1.3.6.1.4.1.311.17.3.20"=>data.Slice(530,10),// KeyIdentifier"1.3.6.1.4.1.311.20.2.3"=>data.Slice(540,10),// UserPrincipalName"1.3.6.1.4.1.311.88.2.1"=>data.Slice(550,10),// DocumentNameAttr"1.3.6.1.4.1.311.88.2.2"=>data.Slice(560,10),// DocumentDescriptionAttr"1.3.6.1.5.5.7.3.1"=>data.Slice(570,8),// KeyPurposeTlsServer"1.3.6.1.5.5.7.3.2"=>data.Slice(578,8),// KeyPurposeTlsClient"1.3.6.1.5.5.7.3.3"=>data.Slice(586,8),// KeyPurposeCodeSign"1.3.6.1.5.5.7.3.4"=>data.Slice(594,8),// KeyPurposeEmailProtection"1.3.6.1.5.5.7.3.8"=>data.Slice(602,8),// KeyPurposeTimestamping"1.3.6.1.5.5.7.3.9"=>data.Slice(610,8),// KeyPurposeOcspSigner"1.3.6.1.5.5.7.6.2"=>data.Slice(618,8),// Pkcs7NoSignature"1.3.6.1.5.5.7.48.1"=>data.Slice(626,8),// OCSP"1.3.6.1.5.5.7.48.1.2"=>data.Slice(634,9),// OcspNonce"1.3.6.1.5.5.7.48.2"=>data.Slice(643,8),// CAIssuers"1.3.14.3.2.26"=>data.Slice(651,5),// SHA1"1.3.14.3.2.7"=>data.Slice(656,5),// DES"1.3.132.0.34"=>data.Slice(661,5),// Secp384r1"1.3.132.0.35"=>data.Slice(666,5),// Secp521r1"2.5.4.3"=>data.Slice(671,3),// CommonName"2.5.4.5"=>data.Slice(674,3),// SerialNumber"2.5.4.6"=>data.Slice(677,3),// CountryOrRegionName"2.5.4.7"=>data.Slice(680,3),// Locality"2.5.4.8"=>data.Slice(683,3),// StateOrProvinceName"2.5.4.10"=>data.Slice(686,3),// OrganizationName"2.5.4.11"=>data.Slice(689,3),// OrganizationalUnit"2.5.4.97"=>data.Slice(692,3),// OrganizationIdentifier"2.5.29.14"=>data.Slice(695,3),// SubjectKeyIdentifier"2.5.29.15"=>data.Slice(698,3),// KeyUsage"2.5.29.17"=>data.Slice(701,3),// SubjectAlternativeName"2.5.29.19"=>data.Slice(704,3),// BasicConstraints"2.5.29.20"=>data.Slice(707,3),// CrlNumber"2.5.29.35"=>data.Slice(710,3),// AuthorityKeyIdentifier"2.16.840.1.101.3.4.1.2"=>data.Slice(713,9),// Aes128Cbc"2.16.840.1.101.3.4.1.22"=>data.Slice(722,9),// Aes192Cbc"2.16.840.1.101.3.4.1.42"=>data.Slice(731,9),// Aes256Cbc"2.16.840.1.101.3.4.2.1"=>data.Slice(740,9),// Sha256"2.16.840.1.101.3.4.2.2"=>data.Slice(749,9),// Sha384"2.16.840.1.101.3.4.2.3"=>data.Slice(758,9),// Sha512"2.23.140.1.2.1"=>data.Slice(767,6),// CabForumDV"2.23.140.1.2.2"=>data.Slice(773,6),// CabForumOV
_ =>ReadOnlySpan<byte>.Empty};}}}

Thank you for your contribution to size reduction @am11 !

@adamsitnikadamsitnik self-assigned this May 17, 2023
@adamsitnik
adamsitnik merged commit 976409d into dotnet:mainMay 17, 2023
@ghostghost locked as resolved and limited conversation to collaborators Jun 16, 2023
@am11
am11 deleted the patch-19 branch June 14, 2024 04:53
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Formats.Asn1size-reductionIssues impacting final app size primary for size sensitive workloads

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@am11@stephentoub@EgorBo@jeffhandley@adamsitnik@bartonjs@teo-tsirpanis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Restructure WellKnownOids.cs - #84921

Merged
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19
May 17, 2023
Merged

Restructure WellKnownOids.cs#84921
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19

Conversation

@am11

@am11am11 commented Apr 17, 2023

Copy link
Copy Markdown
Member

By moving private static ROS to local ROS variable and changing switch expression to switch-case syntax, we save 7.3 KB in NativeAOT app.

It removes System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 largest shared framework methods list:

$ ./build.sh clr+libs+packs -c Release -p:IlcGenerateMapFile=true
$ xmlstarlet sel -t -m "//ObjectNodes/MethodCode" -v 'concat(@Length, ": ", @Name)' -n artifacts/obj/coreclr/crossgen2/arm64/Release/native/crossgen2.map.xml |\
sort -nr | head -10 | grep -E ': (System|S_P)_'| xml unescape

@am11am11 added size-reduction Issues impacting final app size primary for size sensitive workloads area-System.Formats.Asn1 and removed area-System.Formats.Asn1 labels Apr 17, 2023
"2.23.140.1.2.1" => CabForumDV,
"2.23.140.1.2.2" => CabForumOV,
_ => ReadOnlySpan<byte>.Empty,
case "1.2.840.10040.4.1": return DSA;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about you inline the new byte[]s?

@stephentoub

stephentoub commented Apr 17, 2023

Copy link
Copy Markdown
Member

It's fine to switch to using local or inline spans, but I'm not a big fan of changing the switch syntax in the name of saving a few bytes based on how it's currently lowered by the C# compiler. What's the impact of just the syntax change? I'd expect it to just be the difference between N stores into a local and one return vs N returns.

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

Reverted the switch-case change.

@stephentoub

Copy link
Copy Markdown
Member

Can you instead structure it like:

returnvalueswitch{"1.2.840.10040.4.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,},// DSA"1.2.840.10040.4.3"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,},// DSAWithSha1"1.2.840.10045.2.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,},// EC"1.2.840.10045.1.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,},// EcPrimeField"1.2.840.10045.1.2"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,},// EcChar2Field"1.2.840.10045.3.1.7"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,},// Secp256r1
...

?

@EgorBo

Copy link
Copy Markdown
Member

Part of the problem (I've checked the current impl in this PR) is:

Inlines into System.Formats.Asn1.WellKnownOids:GetContents(System.ReadOnlySpan`1[ushort]):System.ReadOnlySpan`1[ubyte]:
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:get_Empty():System.ReadOnlySpan`1[ubyte]

JIT blows up from the number of temp locals, perhaps you can split it into two functions?

@stephentoub

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

@EgorBo

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

Looks like it makes it even worse (more locals), presumably, because Roslyn spills it anyway.
We either need to bump the limit of locals JIT can track or/and I also need to limit "string.Equals" unrolling optimization when we have too many locals already

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

UPD: looks like it's not Span/String.Equals's fault

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

I'm trying another approach by having one local and slicing.

I opened this PR by making change in browser, while my local HEAD was a few days old. Though it still saves 7+ K compared to main, it's no longer dropping System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 list, see the PR description. Looks like some recent change in JIT..

@EgorBo

Copy link
Copy Markdown
Member

Ok, I've bumped the "number of locals JIT can track" limit and it removed all not-inlined methods (all of them are now inlined) and reduced total size of the method in half

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

Looks like some recent change in JIT..

@am11 I think it's either #84530 or #83945

@jeffhandley

Copy link
Copy Markdown
Member

Tagging @dotnet/area-system-formats-asn1 since msftbot was down when the label was applied

Comment on lines +299 to +300
"1.3.132.0.35" => data.Slice(666, 5), // Secp521r1
"2.5.4.3" => data.Slice(671, 3), // CommonName

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a little bothered by how this will make future insertions hard to maintain in the same style. Right now, everything is sorted by the dotted decimal string (or the binary encoding, since they sort the same way). So, if in the future 2.5.4.2 is determined to be common enough to be worth encoding in the table, someone will have to decide between a) putting the new value at the end of the unified blob (being the first unsorted entry) or b) adding 3 to lines 300-321.

That said, adding things to this should be rare; so the savings might pay for the future frustration.

@adamsitnikadamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That said, adding things to this should be rare; so the savings might pay for the future frustration.

I agree with @bartonjs

I wrote a simple console app to verify that the change is not introducing any bug:

Details
namespaceWellKnownTests{internalclassProgram{staticvoidMain(string[]args){Test("1.2.840.10040.4.1");Test("1.2.840.10040.4.3");Test("1.2.840.10045.2.1");Test("1.2.840.10045.1.1");Test("1.2.840.10045.1.2");Test("1.2.840.10045.3.1.7");Test("1.2.840.10045.4.1");Test("1.2.840.10045.4.3.2");Test("1.2.840.10045.4.3.3");Test("1.2.840.10045.4.3.4");Test("1.2.840.113549.1.1.1");Test("1.2.840.113549.1.1.5");Test("1.2.840.113549.1.1.7");Test("1.2.840.113549.1.1.8");Test("1.2.840.113549.1.1.9");Test("1.2.840.113549.1.1.10");Test("1.2.840.113549.1.1.11");Test("1.2.840.113549.1.1.12");Test("1.2.840.113549.1.1.13");Test("1.2.840.113549.1.5.3");Test("1.2.840.113549.1.5.10");Test("1.2.840.113549.1.5.11");Test("1.2.840.113549.1.5.12");Test("1.2.840.113549.1.5.13");Test("1.2.840.113549.1.7.1");Test("1.2.840.113549.1.7.2");Test("1.2.840.113549.1.7.3");Test("1.2.840.113549.1.7.6");Test("1.2.840.113549.1.9.1");Test("1.2.840.113549.1.9.3");Test("1.2.840.113549.1.9.4");Test("1.2.840.113549.1.9.5");Test("1.2.840.113549.1.9.6");Test("1.2.840.113549.1.9.7");Test("1.2.840.113549.1.9.14");Test("1.2.840.113549.1.9.15");Test("1.2.840.113549.1.9.16.1.4");Test("1.2.840.113549.1.9.16.2.12");Test("1.2.840.113549.1.9.16.2.14");Test("1.2.840.113549.1.9.16.2.47");Test("1.2.840.113549.1.9.20");Test("1.2.840.113549.1.9.21");Test("1.2.840.113549.1.9.22.1");Test("1.2.840.113549.1.12.1.3");Test("1.2.840.113549.1.12.1.5");Test("1.2.840.113549.1.12.1.6");Test("1.2.840.113549.1.12.10.1.1");Test("1.2.840.113549.1.12.10.1.2");Test("1.2.840.113549.1.12.10.1.3");Test("1.2.840.113549.1.12.10.1.5");Test("1.2.840.113549.1.12.10.1.6");Test("1.2.840.113549.2.5");Test("1.2.840.113549.2.7");Test("1.2.840.113549.2.9");Test("1.2.840.113549.2.10");Test("1.2.840.113549.2.11");Test("1.2.840.113549.3.2");Test("1.2.840.113549.3.7");Test("1.3.6.1.4.1.311.17.1");Test("1.3.6.1.4.1.311.17.3.20");Test("1.3.6.1.4.1.311.20.2.3");Test("1.3.6.1.4.1.311.88.2.1");Test("1.3.6.1.4.1.311.88.2.2");Test("1.3.6.1.5.5.7.3.1");Test("1.3.6.1.5.5.7.3.2");Test("1.3.6.1.5.5.7.3.3");Test("1.3.6.1.5.5.7.3.4");Test("1.3.6.1.5.5.7.3.8");Test("1.3.6.1.5.5.7.3.9");Test("1.3.6.1.5.5.7.6.2");Test("1.3.6.1.5.5.7.48.1");Test("1.3.6.1.5.5.7.48.1.2");Test("1.3.6.1.5.5.7.48.2");Test("1.3.14.3.2.26");Test("1.3.14.3.2.7");Test("1.3.132.0.34");Test("1.3.132.0.35");Test("2.5.4.3");Test("2.5.4.5");Test("2.5.4.6");Test("2.5.4.7");Test("2.5.4.8");Test("2.5.4.10");Test("2.5.4.11");Test("2.5.4.97");Test("2.5.29.14");Test("2.5.29.15");Test("2.5.29.17");Test("2.5.29.19");Test("2.5.29.20");Test("2.5.29.35");Test("2.16.840.1.101.3.4.1.2");Test("2.16.840.1.101.3.4.1.22");Test("2.16.840.1.101.3.4.1.42");Test("2.16.840.1.101.3.4.2.1");Test("2.16.840.1.101.3.4.2.2");Test("2.16.840.1.101.3.4.2.3");Test("2.23.140.1.2.1");Test("2.23.140.1.2.2");staticvoidTest(stringvalue){ReadOnlySpan<byte>mainContents=WellKnownOids_Main.GetContents(value);ReadOnlySpan<byte>prContents=WellKnownOids_PR.GetContents(value);if(!mainContents.SequenceEqual(prContents)){thrownewException($"GetContents Bug for {value}");}string?mainValue=WellKnownOids_Main.GetValue(mainContents);string?prValue=WellKnownOids_PR.GetValue(prContents);if(prValue!=mainValue){thrownewException($"GetValue Bug for {value}");}}}}internalstaticclassWellKnownOids_Main{privatestaticReadOnlySpan<byte>DSA=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,};privatestaticReadOnlySpan<byte>DSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,};privatestaticReadOnlySpan<byte>EC=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,};privatestaticReadOnlySpan<byte>EcPrimeField=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,};privatestaticReadOnlySpan<byte>EcChar2Field=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,};privatestaticReadOnlySpan<byte>Secp256r1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,};privatestaticReadOnlySpan<byte>ECDSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,};privatestaticReadOnlySpan<byte>ECDSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,};privatestaticReadOnlySpan<byte>ECDSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,};privatestaticReadOnlySpan<byte>ECDSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,};privatestaticReadOnlySpan<byte>RSA=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,};privatestaticReadOnlySpan<byte>RSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,};privatestaticReadOnlySpan<byte>RSAOAEP=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,};privatestaticReadOnlySpan<byte>MGF1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,};privatestaticReadOnlySpan<byte>OaepPSpecified=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,};privatestaticReadOnlySpan<byte>RSAPSS=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,};privatestaticReadOnlySpan<byte>RSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,};privatestaticReadOnlySpan<byte>RSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,};privatestaticReadOnlySpan<byte>RSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,};privatestaticReadOnlySpan<byte>PbeWithMD5AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,};privatestaticReadOnlySpan<byte>PbeWithSha1AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,};privatestaticReadOnlySpan<byte>PbeWithSha1AndRC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,};privatestaticReadOnlySpan<byte>Pbkdf2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,};privatestaticReadOnlySpan<byte>PasswordBasedEncryptionScheme2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,};privatestaticReadOnlySpan<byte>Pkcs7Data=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,};privatestaticReadOnlySpan<byte>Pkcs7SignedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,};privatestaticReadOnlySpan<byte>Pkcs7EnvelopedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,};privatestaticReadOnlySpan<byte>Pkcs7EncryptedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,};privatestaticReadOnlySpan<byte>Pkcs9EmailAddress=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,};privatestaticReadOnlySpan<byte>Pkcs9ContentType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,};privatestaticReadOnlySpan<byte>Pkcs9MessageDigest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,};privatestaticReadOnlySpan<byte>Pkcs9SigningTime=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,};privatestaticReadOnlySpan<byte>Pkcs9CounterSigner=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,};privatestaticReadOnlySpan<byte>Pkcs9Challenge=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,};privatestaticReadOnlySpan<byte>Pkcs9ExtensionRequest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,};privatestaticReadOnlySpan<byte>Pkcs9SMimeCapabilities=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,};privatestaticReadOnlySpan<byte>TstInfo=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,};privatestaticReadOnlySpan<byte>SigningCertificateAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,};privatestaticReadOnlySpan<byte>SignatureTimeStampAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,};privatestaticReadOnlySpan<byte>SigningCertificateV2Attr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,};privatestaticReadOnlySpan<byte>Pkcs9FriendlyName=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,};privatestaticReadOnlySpan<byte>LocalKeyId=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,};privatestaticReadOnlySpan<byte>Pkcs12X509CertType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,};privatestaticReadOnlySpan<byte>Pkcs12TripleDes=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc128=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc40=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,};privatestaticReadOnlySpan<byte>Pkcs12KeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,};privatestaticReadOnlySpan<byte>Pkcs12ShroudedKeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,};privatestaticReadOnlySpan<byte>Pkcs12CertBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12SecretBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12SafeContentsBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,};privatestaticReadOnlySpan<byte>MD5=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,};privatestaticReadOnlySpan<byte>HMACSHA1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,};privatestaticReadOnlySpan<byte>HMACSHA256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,};privatestaticReadOnlySpan<byte>HMACSHA384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,};privatestaticReadOnlySpan<byte>HMACSHA512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,};privatestaticReadOnlySpan<byte>RC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,};privatestaticReadOnlySpan<byte>TripleDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,};privatestaticReadOnlySpan<byte>Pkcs12KeyProviderName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,};privatestaticReadOnlySpan<byte>KeyIdentifier=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,};privatestaticReadOnlySpan<byte>UserPrincipalName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,};privatestaticReadOnlySpan<byte>DocumentNameAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,};privatestaticReadOnlySpan<byte>DocumentDescriptionAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeTlsServer=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,};privatestaticReadOnlySpan<byte>KeyPurposeTlsClient=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeCodeSign=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,};privatestaticReadOnlySpan<byte>KeyPurposeEmailProtection=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,};privatestaticReadOnlySpan<byte>KeyPurposeTimestamping=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,};privatestaticReadOnlySpan<byte>KeyPurposeOcspSigner=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,};privatestaticReadOnlySpan<byte>Pkcs7NoSignature=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,};privatestaticReadOnlySpan<byte>OCSP=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,};privatestaticReadOnlySpan<byte>OcspNonce=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,};privatestaticReadOnlySpan<byte>CAIssuers=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,};privatestaticReadOnlySpan<byte>SHA1=>newbyte[]{0x2B,0x0E,0x03,0x02,0x1A,};privatestaticReadOnlySpan<byte>DES=>newbyte[]{0x2B,0x0E,0x03,0x02,0x07,};privatestaticReadOnlySpan<byte>Secp384r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x22,};privatestaticReadOnlySpan<byte>Secp521r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x23,};privatestaticReadOnlySpan<byte>CommonName=>newbyte[]{0x55,0x04,0x03,};privatestaticReadOnlySpan<byte>SerialNumber=>newbyte[]{0x55,0x04,0x05,};privatestaticReadOnlySpan<byte>CountryOrRegionName=>newbyte[]{0x55,0x04,0x06,};privatestaticReadOnlySpan<byte>Locality=>newbyte[]{0x55,0x04,0x07,};privatestaticReadOnlySpan<byte>StateOrProvinceName=>newbyte[]{0x55,0x04,0x08,};privatestaticReadOnlySpan<byte>OrganizationName=>newbyte[]{0x55,0x04,0x0A,};privatestaticReadOnlySpan<byte>OrganizationalUnit=>newbyte[]{0x55,0x04,0x0B,};privatestaticReadOnlySpan<byte>OrganizationIdentifier=>newbyte[]{0x55,0x04,0x61,};privatestaticReadOnlySpan<byte>SubjectKeyIdentifier=>newbyte[]{0x55,0x1D,0x0E,};privatestaticReadOnlySpan<byte>KeyUsage=>newbyte[]{0x55,0x1D,0x0F,};privatestaticReadOnlySpan<byte>SubjectAlternativeName=>newbyte[]{0x55,0x1D,0x11,};privatestaticReadOnlySpan<byte>BasicConstraints=>newbyte[]{0x55,0x1D,0x13,};privatestaticReadOnlySpan<byte>CrlNumber=>newbyte[]{0x55,0x1D,0x14,};privatestaticReadOnlySpan<byte>AuthorityKeyIdentifier=>newbyte[]{0x55,0x1D,0x23,};privatestaticReadOnlySpan<byte>Aes128Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,};privatestaticReadOnlySpan<byte>Aes192Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,};privatestaticReadOnlySpan<byte>Aes256Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,};privatestaticReadOnlySpan<byte>Sha256=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,};privatestaticReadOnlySpan<byte>Sha384=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,};privatestaticReadOnlySpan<byte>Sha512=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,};privatestaticReadOnlySpan<byte>CabForumDV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x01,};privatestaticReadOnlySpan<byte>CabForumOV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x02,};internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){returnvalueswitch{"1.2.840.10040.4.1"=>DSA,"1.2.840.10040.4.3"=>DSAWithSha1,"1.2.840.10045.2.1"=>EC,"1.2.840.10045.1.1"=>EcPrimeField,"1.2.840.10045.1.2"=>EcChar2Field,"1.2.840.10045.3.1.7"=>Secp256r1,"1.2.840.10045.4.1"=>ECDSAWithSha1,"1.2.840.10045.4.3.2"=>ECDSAWithSha256,"1.2.840.10045.4.3.3"=>ECDSAWithSha384,"1.2.840.10045.4.3.4"=>ECDSAWithSha512,"1.2.840.113549.1.1.1"=>RSA,"1.2.840.113549.1.1.5"=>RSAWithSha1,"1.2.840.113549.1.1.7"=>RSAOAEP,"1.2.840.113549.1.1.8"=>MGF1,"1.2.840.113549.1.1.9"=>OaepPSpecified,"1.2.840.113549.1.1.10"=>RSAPSS,"1.2.840.113549.1.1.11"=>RSAWithSha256,"1.2.840.113549.1.1.12"=>RSAWithSha384,"1.2.840.113549.1.1.13"=>RSAWithSha512,"1.2.840.113549.1.5.3"=>PbeWithMD5AndDESCBC,"1.2.840.113549.1.5.10"=>PbeWithSha1AndDESCBC,"1.2.840.113549.1.5.11"=>PbeWithSha1AndRC2CBC,"1.2.840.113549.1.5.12"=>Pbkdf2,"1.2.840.113549.1.5.13"=>PasswordBasedEncryptionScheme2,"1.2.840.113549.1.7.1"=>Pkcs7Data,"1.2.840.113549.1.7.2"=>Pkcs7SignedData,"1.2.840.113549.1.7.3"=>Pkcs7EnvelopedData,"1.2.840.113549.1.7.6"=>Pkcs7EncryptedData,"1.2.840.113549.1.9.1"=>Pkcs9EmailAddress,"1.2.840.113549.1.9.3"=>Pkcs9ContentType,"1.2.840.113549.1.9.4"=>Pkcs9MessageDigest,"1.2.840.113549.1.9.5"=>Pkcs9SigningTime,"1.2.840.113549.1.9.6"=>Pkcs9CounterSigner,"1.2.840.113549.1.9.7"=>Pkcs9Challenge,"1.2.840.113549.1.9.14"=>Pkcs9ExtensionRequest,"1.2.840.113549.1.9.15"=>Pkcs9SMimeCapabilities,"1.2.840.113549.1.9.16.1.4"=>TstInfo,"1.2.840.113549.1.9.16.2.12"=>SigningCertificateAttr,"1.2.840.113549.1.9.16.2.14"=>SignatureTimeStampAttr,"1.2.840.113549.1.9.16.2.47"=>SigningCertificateV2Attr,"1.2.840.113549.1.9.20"=>Pkcs9FriendlyName,"1.2.840.113549.1.9.21"=>LocalKeyId,"1.2.840.113549.1.9.22.1"=>Pkcs12X509CertType,"1.2.840.113549.1.12.1.3"=>Pkcs12TripleDes,"1.2.840.113549.1.12.1.5"=>Pkcs12Rc2Cbc128,"1.2.840.113549.1.12.1.6"=>Pkcs12Rc2Cbc40,"1.2.840.113549.1.12.10.1.1"=>Pkcs12KeyBag,"1.2.840.113549.1.12.10.1.2"=>Pkcs12ShroudedKeyBag,"1.2.840.113549.1.12.10.1.3"=>Pkcs12CertBag,"1.2.840.113549.1.12.10.1.5"=>Pkcs12SecretBag,"1.2.840.113549.1.12.10.1.6"=>Pkcs12SafeContentsBag,"1.2.840.113549.2.5"=>MD5,"1.2.840.113549.2.7"=>HMACSHA1,"1.2.840.113549.2.9"=>HMACSHA256,"1.2.840.113549.2.10"=>HMACSHA384,"1.2.840.113549.2.11"=>HMACSHA512,"1.2.840.113549.3.2"=>RC2CBC,"1.2.840.113549.3.7"=>TripleDESCBC,"1.3.6.1.4.1.311.17.1"=>Pkcs12KeyProviderName,"1.3.6.1.4.1.311.17.3.20"=>KeyIdentifier,"1.3.6.1.4.1.311.20.2.3"=>UserPrincipalName,"1.3.6.1.4.1.311.88.2.1"=>DocumentNameAttr,"1.3.6.1.4.1.311.88.2.2"=>DocumentDescriptionAttr,"1.3.6.1.5.5.7.3.1"=>KeyPurposeTlsServer,"1.3.6.1.5.5.7.3.2"=>KeyPurposeTlsClient,"1.3.6.1.5.5.7.3.3"=>KeyPurposeCodeSign,"1.3.6.1.5.5.7.3.4"=>KeyPurposeEmailProtection,"1.3.6.1.5.5.7.3.8"=>KeyPurposeTimestamping,"1.3.6.1.5.5.7.3.9"=>KeyPurposeOcspSigner,"1.3.6.1.5.5.7.6.2"=>Pkcs7NoSignature,"1.3.6.1.5.5.7.48.1"=>OCSP,"1.3.6.1.5.5.7.48.1.2"=>OcspNonce,"1.3.6.1.5.5.7.48.2"=>CAIssuers,"1.3.14.3.2.26"=>SHA1,"1.3.14.3.2.7"=>DES,"1.3.132.0.34"=>Secp384r1,"1.3.132.0.35"=>Secp521r1,"2.5.4.3"=>CommonName,"2.5.4.5"=>SerialNumber,"2.5.4.6"=>CountryOrRegionName,"2.5.4.7"=>Locality,"2.5.4.8"=>StateOrProvinceName,"2.5.4.10"=>OrganizationName,"2.5.4.11"=>OrganizationalUnit,"2.5.4.97"=>OrganizationIdentifier,"2.5.29.14"=>SubjectKeyIdentifier,"2.5.29.15"=>KeyUsage,"2.5.29.17"=>SubjectAlternativeName,"2.5.29.19"=>BasicConstraints,"2.5.29.20"=>CrlNumber,"2.5.29.35"=>AuthorityKeyIdentifier,"2.16.840.1.101.3.4.1.2"=>Aes128Cbc,"2.16.840.1.101.3.4.1.22"=>Aes192Cbc,"2.16.840.1.101.3.4.1.42"=>Aes256Cbc,"2.16.840.1.101.3.4.2.1"=>Sha256,"2.16.840.1.101.3.4.2.2"=>Sha384,"2.16.840.1.101.3.4.2.3"=>Sha512,"2.23.140.1.2.1"=>CabForumDV,"2.23.140.1.2.2"=>CabForumOV,
_ =>ReadOnlySpan<byte>.Empty,};}}internalstaticclassWellKnownOids_PR{internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){ReadOnlySpan<byte>data=newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,// DSA0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,// DSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,// EC0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,// EcPrimeField0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,// EcChar2Field0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,// Secp256r10x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,// ECDSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,// ECDSAWithSha2560x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,// ECDSAWithSha3840x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,// ECDSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,// RSA0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,// RSAWithSha10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,// RSAOAEP0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,// MGF10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,// OaepPSpecified0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,// RSAPSS0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,// RSAWithSha2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,// RSAWithSha3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,// RSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,// PbeWithMD5AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,// PbeWithSha1AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,// PbeWithSha1AndRC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,// Pbkdf20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,// PasswordBasedEncryptionScheme20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,// Pkcs7Data0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,// Pkcs7SignedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,// Pkcs7EnvelopedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,// Pkcs7EncryptedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,// Pkcs9EmailAddress0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,// Pkcs9ContentType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,// Pkcs9MessageDigest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,// Pkcs9SigningTime0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,// Pkcs9CounterSigner0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,// Pkcs9Challenge0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,// Pkcs9ExtensionRequest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,// Pkcs9SMimeCapabilities0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,// TstInfo0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,// SigningCertificateAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,// SignatureTimeStampAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,// SigningCertificateV2Attr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,// Pkcs9FriendlyName0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,// LocalKeyId0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,// Pkcs12X509CertType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,// Pkcs12TripleDes0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,// Pkcs12Rc2Cbc1280x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,// Pkcs12Rc2Cbc400x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,// Pkcs12KeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,// Pkcs12ShroudedKeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,// Pkcs12CertBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,// Pkcs12SecretBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,// Pkcs12SafeContentsBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,// MD50x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,// HMACSHA10x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,// HMACSHA2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,// HMACSHA3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,// HMACSHA5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,// RC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,// TripleDESCBC0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,// Pkcs12KeyProviderName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,// KeyIdentifier0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,// UserPrincipalName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,// DocumentNameAttr0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,// DocumentDescriptionAttr0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,// KeyPurposeTlsServer0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,// KeyPurposeTlsClient0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,// KeyPurposeCodeSign0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,// KeyPurposeEmailProtection0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,// KeyPurposeTimestamping0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,// KeyPurposeOcspSigner0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,// Pkcs7NoSignature0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,// OCSP0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,// OcspNonce0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,// CAIssuers0x2B,0x0E,0x03,0x02,0x1A,// SHA10x2B,0x0E,0x03,0x02,0x07,// DES0x2B,0x81,0x04,0x00,0x22,// Secp384r10x2B,0x81,0x04,0x00,0x23,// Secp521r10x55,0x04,0x03,// CommonName0x55,0x04,0x05,// SerialNumber0x55,0x04,0x06,// CountryOrRegionName0x55,0x04,0x07,// Locality0x55,0x04,0x08,// StateOrProvinceName0x55,0x04,0x0A,// OrganizationName0x55,0x04,0x0B,// OrganizationalUnit0x55,0x04,0x61,// OrganizationIdentifier0x55,0x1D,0x0E,// SubjectKeyIdentifier0x55,0x1D,0x0F,// KeyUsage0x55,0x1D,0x11,// SubjectAlternativeName0x55,0x1D,0x13,// BasicConstraints0x55,0x1D,0x14,// CrlNumber0x55,0x1D,0x23,// AuthorityKeyIdentifier0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,// Aes128Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,// Aes192Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,// Aes256Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,// Sha2560x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,// Sha3840x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,// Sha5120x67,0x81,0x0C,0x01,0x02,0x01,// CabForumDV0x67,0x81,0x0C,0x01,0x02,0x02,// CabForumOV};returnvalueswitch{"1.2.840.10040.4.1"=>data.Slice(0,7),// DSA"1.2.840.10040.4.3"=>data.Slice(7,7),// DSAWithSha1"1.2.840.10045.2.1"=>data.Slice(14,7),// EC"1.2.840.10045.1.1"=>data.Slice(21,7),// EcPrimeField"1.2.840.10045.1.2"=>data.Slice(28,7),// EcChar2Field"1.2.840.10045.3.1.7"=>data.Slice(35,8),// Secp256r1"1.2.840.10045.4.1"=>data.Slice(43,7),// ECDSAWithSha1"1.2.840.10045.4.3.2"=>data.Slice(50,8),// ECDSAWithSha256"1.2.840.10045.4.3.3"=>data.Slice(58,8),// ECDSAWithSha384"1.2.840.10045.4.3.4"=>data.Slice(66,8),// ECDSAWithSha512"1.2.840.113549.1.1.1"=>data.Slice(74,9),// RSA"1.2.840.113549.1.1.5"=>data.Slice(83,9),// RSAWithSha1"1.2.840.113549.1.1.7"=>data.Slice(92,9),// RSAOAEP"1.2.840.113549.1.1.8"=>data.Slice(101,9),// MGF1"1.2.840.113549.1.1.9"=>data.Slice(110,9),// OaepPSpecified"1.2.840.113549.1.1.10"=>data.Slice(119,9),// RSAPSS"1.2.840.113549.1.1.11"=>data.Slice(128,9),// RSAWithSha256"1.2.840.113549.1.1.12"=>data.Slice(137,9),// RSAWithSha384"1.2.840.113549.1.1.13"=>data.Slice(146,9),// RSAWithSha512"1.2.840.113549.1.5.3"=>data.Slice(155,9),// PbeWithMD5AndDESCBC"1.2.840.113549.1.5.10"=>data.Slice(164,9),// PbeWithSha1AndDESCBC"1.2.840.113549.1.5.11"=>data.Slice(173,9),// PbeWithSha1AndRC2CBC"1.2.840.113549.1.5.12"=>data.Slice(182,9),// Pbkdf2"1.2.840.113549.1.5.13"=>data.Slice(191,9),// PasswordBasedEncryptionScheme2"1.2.840.113549.1.7.1"=>data.Slice(200,9),// Pkcs7Data"1.2.840.113549.1.7.2"=>data.Slice(209,9),// Pkcs7SignedData"1.2.840.113549.1.7.3"=>data.Slice(218,9),// Pkcs7EnvelopedData"1.2.840.113549.1.7.6"=>data.Slice(227,9),// Pkcs7EncryptedData"1.2.840.113549.1.9.1"=>data.Slice(236,9),// Pkcs9EmailAddress"1.2.840.113549.1.9.3"=>data.Slice(245,9),// Pkcs9ContentType"1.2.840.113549.1.9.4"=>data.Slice(254,9),// Pkcs9MessageDigest"1.2.840.113549.1.9.5"=>data.Slice(263,9),// Pkcs9SigningTime"1.2.840.113549.1.9.6"=>data.Slice(272,9),// Pkcs9CounterSigner"1.2.840.113549.1.9.7"=>data.Slice(281,9),// Pkcs9Challenge"1.2.840.113549.1.9.14"=>data.Slice(290,9),// Pkcs9ExtensionRequest"1.2.840.113549.1.9.15"=>data.Slice(299,9),// Pkcs9SMimeCapabilities"1.2.840.113549.1.9.16.1.4"=>data.Slice(308,11),// TstInfo"1.2.840.113549.1.9.16.2.12"=>data.Slice(319,11),// SigningCertificateAttr"1.2.840.113549.1.9.16.2.14"=>data.Slice(330,11),// SignatureTimeStampAttr"1.2.840.113549.1.9.16.2.47"=>data.Slice(341,11),// SigningCertificateV2Attr"1.2.840.113549.1.9.20"=>data.Slice(352,9),// Pkcs9FriendlyName"1.2.840.113549.1.9.21"=>data.Slice(361,9),// LocalKeyId"1.2.840.113549.1.9.22.1"=>data.Slice(370,10),// Pkcs12X509CertType"1.2.840.113549.1.12.1.3"=>data.Slice(380,10),// Pkcs12TripleDes"1.2.840.113549.1.12.1.5"=>data.Slice(390,10),// Pkcs12Rc2Cbc128"1.2.840.113549.1.12.1.6"=>data.Slice(400,10),// Pkcs12Rc2Cbc40"1.2.840.113549.1.12.10.1.1"=>data.Slice(410,11),// Pkcs12KeyBag"1.2.840.113549.1.12.10.1.2"=>data.Slice(421,11),// Pkcs12ShroudedKeyBag"1.2.840.113549.1.12.10.1.3"=>data.Slice(432,11),// Pkcs12CertBag"1.2.840.113549.1.12.10.1.5"=>data.Slice(443,11),// Pkcs12SecretBag"1.2.840.113549.1.12.10.1.6"=>data.Slice(454,11),// Pkcs12SafeContentsBag"1.2.840.113549.2.5"=>data.Slice(465,8),// MD5"1.2.840.113549.2.7"=>data.Slice(473,8),// HMACSHA1"1.2.840.113549.2.9"=>data.Slice(481,8),// HMACSHA256"1.2.840.113549.2.10"=>data.Slice(489,8),// HMACSHA384"1.2.840.113549.2.11"=>data.Slice(497,8),// HMACSHA512"1.2.840.113549.3.2"=>data.Slice(505,8),// RC2CBC"1.2.840.113549.3.7"=>data.Slice(513,8),// TripleDESCBC"1.3.6.1.4.1.311.17.1"=>data.Slice(521,9),// Pkcs12KeyProviderName"1.3.6.1.4.1.311.17.3.20"=>data.Slice(530,10),// KeyIdentifier"1.3.6.1.4.1.311.20.2.3"=>data.Slice(540,10),// UserPrincipalName"1.3.6.1.4.1.311.88.2.1"=>data.Slice(550,10),// DocumentNameAttr"1.3.6.1.4.1.311.88.2.2"=>data.Slice(560,10),// DocumentDescriptionAttr"1.3.6.1.5.5.7.3.1"=>data.Slice(570,8),// KeyPurposeTlsServer"1.3.6.1.5.5.7.3.2"=>data.Slice(578,8),// KeyPurposeTlsClient"1.3.6.1.5.5.7.3.3"=>data.Slice(586,8),// KeyPurposeCodeSign"1.3.6.1.5.5.7.3.4"=>data.Slice(594,8),// KeyPurposeEmailProtection"1.3.6.1.5.5.7.3.8"=>data.Slice(602,8),// KeyPurposeTimestamping"1.3.6.1.5.5.7.3.9"=>data.Slice(610,8),// KeyPurposeOcspSigner"1.3.6.1.5.5.7.6.2"=>data.Slice(618,8),// Pkcs7NoSignature"1.3.6.1.5.5.7.48.1"=>data.Slice(626,8),// OCSP"1.3.6.1.5.5.7.48.1.2"=>data.Slice(634,9),// OcspNonce"1.3.6.1.5.5.7.48.2"=>data.Slice(643,8),// CAIssuers"1.3.14.3.2.26"=>data.Slice(651,5),// SHA1"1.3.14.3.2.7"=>data.Slice(656,5),// DES"1.3.132.0.34"=>data.Slice(661,5),// Secp384r1"1.3.132.0.35"=>data.Slice(666,5),// Secp521r1"2.5.4.3"=>data.Slice(671,3),// CommonName"2.5.4.5"=>data.Slice(674,3),// SerialNumber"2.5.4.6"=>data.Slice(677,3),// CountryOrRegionName"2.5.4.7"=>data.Slice(680,3),// Locality"2.5.4.8"=>data.Slice(683,3),// StateOrProvinceName"2.5.4.10"=>data.Slice(686,3),// OrganizationName"2.5.4.11"=>data.Slice(689,3),// OrganizationalUnit"2.5.4.97"=>data.Slice(692,3),// OrganizationIdentifier"2.5.29.14"=>data.Slice(695,3),// SubjectKeyIdentifier"2.5.29.15"=>data.Slice(698,3),// KeyUsage"2.5.29.17"=>data.Slice(701,3),// SubjectAlternativeName"2.5.29.19"=>data.Slice(704,3),// BasicConstraints"2.5.29.20"=>data.Slice(707,3),// CrlNumber"2.5.29.35"=>data.Slice(710,3),// AuthorityKeyIdentifier"2.16.840.1.101.3.4.1.2"=>data.Slice(713,9),// Aes128Cbc"2.16.840.1.101.3.4.1.22"=>data.Slice(722,9),// Aes192Cbc"2.16.840.1.101.3.4.1.42"=>data.Slice(731,9),// Aes256Cbc"2.16.840.1.101.3.4.2.1"=>data.Slice(740,9),// Sha256"2.16.840.1.101.3.4.2.2"=>data.Slice(749,9),// Sha384"2.16.840.1.101.3.4.2.3"=>data.Slice(758,9),// Sha512"2.23.140.1.2.1"=>data.Slice(767,6),// CabForumDV"2.23.140.1.2.2"=>data.Slice(773,6),// CabForumOV
_ =>ReadOnlySpan<byte>.Empty};}}}

Thank you for your contribution to size reduction @am11 !

@adamsitnikadamsitnik self-assigned this May 17, 2023
@adamsitnik
adamsitnik merged commit 976409d into dotnet:mainMay 17, 2023
@ghostghost locked as resolved and limited conversation to collaborators Jun 16, 2023
@am11
am11 deleted the patch-19 branch June 14, 2024 04:53
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Formats.Asn1size-reductionIssues impacting final app size primary for size sensitive workloads

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@am11@stephentoub@EgorBo@jeffhandley@adamsitnik@bartonjs@teo-tsirpanis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Restructure WellKnownOids.cs - #84921

Merged
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19
May 17, 2023
Merged

Restructure WellKnownOids.cs#84921
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19

Conversation

@am11

@am11am11 commented Apr 17, 2023

Copy link
Copy Markdown
Member

By moving private static ROS to local ROS variable and changing switch expression to switch-case syntax, we save 7.3 KB in NativeAOT app.

It removes System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 largest shared framework methods list:

$ ./build.sh clr+libs+packs -c Release -p:IlcGenerateMapFile=true
$ xmlstarlet sel -t -m "//ObjectNodes/MethodCode" -v 'concat(@Length, ": ", @Name)' -n artifacts/obj/coreclr/crossgen2/arm64/Release/native/crossgen2.map.xml |\
sort -nr | head -10 | grep -E ': (System|S_P)_'| xml unescape

@am11am11 added size-reduction Issues impacting final app size primary for size sensitive workloads area-System.Formats.Asn1 and removed area-System.Formats.Asn1 labels Apr 17, 2023
"2.23.140.1.2.1" => CabForumDV,
"2.23.140.1.2.2" => CabForumOV,
_ => ReadOnlySpan<byte>.Empty,
case "1.2.840.10040.4.1": return DSA;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about you inline the new byte[]s?

@stephentoub

stephentoub commented Apr 17, 2023

Copy link
Copy Markdown
Member

It's fine to switch to using local or inline spans, but I'm not a big fan of changing the switch syntax in the name of saving a few bytes based on how it's currently lowered by the C# compiler. What's the impact of just the syntax change? I'd expect it to just be the difference between N stores into a local and one return vs N returns.

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

Reverted the switch-case change.

@stephentoub

Copy link
Copy Markdown
Member

Can you instead structure it like:

returnvalueswitch{"1.2.840.10040.4.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,},// DSA"1.2.840.10040.4.3"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,},// DSAWithSha1"1.2.840.10045.2.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,},// EC"1.2.840.10045.1.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,},// EcPrimeField"1.2.840.10045.1.2"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,},// EcChar2Field"1.2.840.10045.3.1.7"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,},// Secp256r1
...

?

@EgorBo

Copy link
Copy Markdown
Member

Part of the problem (I've checked the current impl in this PR) is:

Inlines into System.Formats.Asn1.WellKnownOids:GetContents(System.ReadOnlySpan`1[ushort]):System.ReadOnlySpan`1[ubyte]:
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:get_Empty():System.ReadOnlySpan`1[ubyte]

JIT blows up from the number of temp locals, perhaps you can split it into two functions?

@stephentoub

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

@EgorBo

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

Looks like it makes it even worse (more locals), presumably, because Roslyn spills it anyway.
We either need to bump the limit of locals JIT can track or/and I also need to limit "string.Equals" unrolling optimization when we have too many locals already

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

UPD: looks like it's not Span/String.Equals's fault

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

I'm trying another approach by having one local and slicing.

I opened this PR by making change in browser, while my local HEAD was a few days old. Though it still saves 7+ K compared to main, it's no longer dropping System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 list, see the PR description. Looks like some recent change in JIT..

@EgorBo

Copy link
Copy Markdown
Member

Ok, I've bumped the "number of locals JIT can track" limit and it removed all not-inlined methods (all of them are now inlined) and reduced total size of the method in half

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

Looks like some recent change in JIT..

@am11 I think it's either #84530 or #83945

@jeffhandley

Copy link
Copy Markdown
Member

Tagging @dotnet/area-system-formats-asn1 since msftbot was down when the label was applied

Comment on lines +299 to +300
"1.3.132.0.35" => data.Slice(666, 5), // Secp521r1
"2.5.4.3" => data.Slice(671, 3), // CommonName

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a little bothered by how this will make future insertions hard to maintain in the same style. Right now, everything is sorted by the dotted decimal string (or the binary encoding, since they sort the same way). So, if in the future 2.5.4.2 is determined to be common enough to be worth encoding in the table, someone will have to decide between a) putting the new value at the end of the unified blob (being the first unsorted entry) or b) adding 3 to lines 300-321.

That said, adding things to this should be rare; so the savings might pay for the future frustration.

@adamsitnikadamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That said, adding things to this should be rare; so the savings might pay for the future frustration.

I agree with @bartonjs

I wrote a simple console app to verify that the change is not introducing any bug:

Details
namespaceWellKnownTests{internalclassProgram{staticvoidMain(string[]args){Test("1.2.840.10040.4.1");Test("1.2.840.10040.4.3");Test("1.2.840.10045.2.1");Test("1.2.840.10045.1.1");Test("1.2.840.10045.1.2");Test("1.2.840.10045.3.1.7");Test("1.2.840.10045.4.1");Test("1.2.840.10045.4.3.2");Test("1.2.840.10045.4.3.3");Test("1.2.840.10045.4.3.4");Test("1.2.840.113549.1.1.1");Test("1.2.840.113549.1.1.5");Test("1.2.840.113549.1.1.7");Test("1.2.840.113549.1.1.8");Test("1.2.840.113549.1.1.9");Test("1.2.840.113549.1.1.10");Test("1.2.840.113549.1.1.11");Test("1.2.840.113549.1.1.12");Test("1.2.840.113549.1.1.13");Test("1.2.840.113549.1.5.3");Test("1.2.840.113549.1.5.10");Test("1.2.840.113549.1.5.11");Test("1.2.840.113549.1.5.12");Test("1.2.840.113549.1.5.13");Test("1.2.840.113549.1.7.1");Test("1.2.840.113549.1.7.2");Test("1.2.840.113549.1.7.3");Test("1.2.840.113549.1.7.6");Test("1.2.840.113549.1.9.1");Test("1.2.840.113549.1.9.3");Test("1.2.840.113549.1.9.4");Test("1.2.840.113549.1.9.5");Test("1.2.840.113549.1.9.6");Test("1.2.840.113549.1.9.7");Test("1.2.840.113549.1.9.14");Test("1.2.840.113549.1.9.15");Test("1.2.840.113549.1.9.16.1.4");Test("1.2.840.113549.1.9.16.2.12");Test("1.2.840.113549.1.9.16.2.14");Test("1.2.840.113549.1.9.16.2.47");Test("1.2.840.113549.1.9.20");Test("1.2.840.113549.1.9.21");Test("1.2.840.113549.1.9.22.1");Test("1.2.840.113549.1.12.1.3");Test("1.2.840.113549.1.12.1.5");Test("1.2.840.113549.1.12.1.6");Test("1.2.840.113549.1.12.10.1.1");Test("1.2.840.113549.1.12.10.1.2");Test("1.2.840.113549.1.12.10.1.3");Test("1.2.840.113549.1.12.10.1.5");Test("1.2.840.113549.1.12.10.1.6");Test("1.2.840.113549.2.5");Test("1.2.840.113549.2.7");Test("1.2.840.113549.2.9");Test("1.2.840.113549.2.10");Test("1.2.840.113549.2.11");Test("1.2.840.113549.3.2");Test("1.2.840.113549.3.7");Test("1.3.6.1.4.1.311.17.1");Test("1.3.6.1.4.1.311.17.3.20");Test("1.3.6.1.4.1.311.20.2.3");Test("1.3.6.1.4.1.311.88.2.1");Test("1.3.6.1.4.1.311.88.2.2");Test("1.3.6.1.5.5.7.3.1");Test("1.3.6.1.5.5.7.3.2");Test("1.3.6.1.5.5.7.3.3");Test("1.3.6.1.5.5.7.3.4");Test("1.3.6.1.5.5.7.3.8");Test("1.3.6.1.5.5.7.3.9");Test("1.3.6.1.5.5.7.6.2");Test("1.3.6.1.5.5.7.48.1");Test("1.3.6.1.5.5.7.48.1.2");Test("1.3.6.1.5.5.7.48.2");Test("1.3.14.3.2.26");Test("1.3.14.3.2.7");Test("1.3.132.0.34");Test("1.3.132.0.35");Test("2.5.4.3");Test("2.5.4.5");Test("2.5.4.6");Test("2.5.4.7");Test("2.5.4.8");Test("2.5.4.10");Test("2.5.4.11");Test("2.5.4.97");Test("2.5.29.14");Test("2.5.29.15");Test("2.5.29.17");Test("2.5.29.19");Test("2.5.29.20");Test("2.5.29.35");Test("2.16.840.1.101.3.4.1.2");Test("2.16.840.1.101.3.4.1.22");Test("2.16.840.1.101.3.4.1.42");Test("2.16.840.1.101.3.4.2.1");Test("2.16.840.1.101.3.4.2.2");Test("2.16.840.1.101.3.4.2.3");Test("2.23.140.1.2.1");Test("2.23.140.1.2.2");staticvoidTest(stringvalue){ReadOnlySpan<byte>mainContents=WellKnownOids_Main.GetContents(value);ReadOnlySpan<byte>prContents=WellKnownOids_PR.GetContents(value);if(!mainContents.SequenceEqual(prContents)){thrownewException($"GetContents Bug for {value}");}string?mainValue=WellKnownOids_Main.GetValue(mainContents);string?prValue=WellKnownOids_PR.GetValue(prContents);if(prValue!=mainValue){thrownewException($"GetValue Bug for {value}");}}}}internalstaticclassWellKnownOids_Main{privatestaticReadOnlySpan<byte>DSA=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,};privatestaticReadOnlySpan<byte>DSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,};privatestaticReadOnlySpan<byte>EC=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,};privatestaticReadOnlySpan<byte>EcPrimeField=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,};privatestaticReadOnlySpan<byte>EcChar2Field=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,};privatestaticReadOnlySpan<byte>Secp256r1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,};privatestaticReadOnlySpan<byte>ECDSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,};privatestaticReadOnlySpan<byte>ECDSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,};privatestaticReadOnlySpan<byte>ECDSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,};privatestaticReadOnlySpan<byte>ECDSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,};privatestaticReadOnlySpan<byte>RSA=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,};privatestaticReadOnlySpan<byte>RSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,};privatestaticReadOnlySpan<byte>RSAOAEP=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,};privatestaticReadOnlySpan<byte>MGF1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,};privatestaticReadOnlySpan<byte>OaepPSpecified=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,};privatestaticReadOnlySpan<byte>RSAPSS=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,};privatestaticReadOnlySpan<byte>RSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,};privatestaticReadOnlySpan<byte>RSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,};privatestaticReadOnlySpan<byte>RSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,};privatestaticReadOnlySpan<byte>PbeWithMD5AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,};privatestaticReadOnlySpan<byte>PbeWithSha1AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,};privatestaticReadOnlySpan<byte>PbeWithSha1AndRC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,};privatestaticReadOnlySpan<byte>Pbkdf2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,};privatestaticReadOnlySpan<byte>PasswordBasedEncryptionScheme2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,};privatestaticReadOnlySpan<byte>Pkcs7Data=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,};privatestaticReadOnlySpan<byte>Pkcs7SignedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,};privatestaticReadOnlySpan<byte>Pkcs7EnvelopedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,};privatestaticReadOnlySpan<byte>Pkcs7EncryptedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,};privatestaticReadOnlySpan<byte>Pkcs9EmailAddress=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,};privatestaticReadOnlySpan<byte>Pkcs9ContentType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,};privatestaticReadOnlySpan<byte>Pkcs9MessageDigest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,};privatestaticReadOnlySpan<byte>Pkcs9SigningTime=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,};privatestaticReadOnlySpan<byte>Pkcs9CounterSigner=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,};privatestaticReadOnlySpan<byte>Pkcs9Challenge=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,};privatestaticReadOnlySpan<byte>Pkcs9ExtensionRequest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,};privatestaticReadOnlySpan<byte>Pkcs9SMimeCapabilities=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,};privatestaticReadOnlySpan<byte>TstInfo=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,};privatestaticReadOnlySpan<byte>SigningCertificateAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,};privatestaticReadOnlySpan<byte>SignatureTimeStampAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,};privatestaticReadOnlySpan<byte>SigningCertificateV2Attr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,};privatestaticReadOnlySpan<byte>Pkcs9FriendlyName=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,};privatestaticReadOnlySpan<byte>LocalKeyId=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,};privatestaticReadOnlySpan<byte>Pkcs12X509CertType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,};privatestaticReadOnlySpan<byte>Pkcs12TripleDes=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc128=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc40=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,};privatestaticReadOnlySpan<byte>Pkcs12KeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,};privatestaticReadOnlySpan<byte>Pkcs12ShroudedKeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,};privatestaticReadOnlySpan<byte>Pkcs12CertBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12SecretBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12SafeContentsBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,};privatestaticReadOnlySpan<byte>MD5=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,};privatestaticReadOnlySpan<byte>HMACSHA1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,};privatestaticReadOnlySpan<byte>HMACSHA256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,};privatestaticReadOnlySpan<byte>HMACSHA384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,};privatestaticReadOnlySpan<byte>HMACSHA512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,};privatestaticReadOnlySpan<byte>RC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,};privatestaticReadOnlySpan<byte>TripleDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,};privatestaticReadOnlySpan<byte>Pkcs12KeyProviderName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,};privatestaticReadOnlySpan<byte>KeyIdentifier=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,};privatestaticReadOnlySpan<byte>UserPrincipalName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,};privatestaticReadOnlySpan<byte>DocumentNameAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,};privatestaticReadOnlySpan<byte>DocumentDescriptionAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeTlsServer=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,};privatestaticReadOnlySpan<byte>KeyPurposeTlsClient=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeCodeSign=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,};privatestaticReadOnlySpan<byte>KeyPurposeEmailProtection=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,};privatestaticReadOnlySpan<byte>KeyPurposeTimestamping=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,};privatestaticReadOnlySpan<byte>KeyPurposeOcspSigner=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,};privatestaticReadOnlySpan<byte>Pkcs7NoSignature=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,};privatestaticReadOnlySpan<byte>OCSP=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,};privatestaticReadOnlySpan<byte>OcspNonce=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,};privatestaticReadOnlySpan<byte>CAIssuers=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,};privatestaticReadOnlySpan<byte>SHA1=>newbyte[]{0x2B,0x0E,0x03,0x02,0x1A,};privatestaticReadOnlySpan<byte>DES=>newbyte[]{0x2B,0x0E,0x03,0x02,0x07,};privatestaticReadOnlySpan<byte>Secp384r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x22,};privatestaticReadOnlySpan<byte>Secp521r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x23,};privatestaticReadOnlySpan<byte>CommonName=>newbyte[]{0x55,0x04,0x03,};privatestaticReadOnlySpan<byte>SerialNumber=>newbyte[]{0x55,0x04,0x05,};privatestaticReadOnlySpan<byte>CountryOrRegionName=>newbyte[]{0x55,0x04,0x06,};privatestaticReadOnlySpan<byte>Locality=>newbyte[]{0x55,0x04,0x07,};privatestaticReadOnlySpan<byte>StateOrProvinceName=>newbyte[]{0x55,0x04,0x08,};privatestaticReadOnlySpan<byte>OrganizationName=>newbyte[]{0x55,0x04,0x0A,};privatestaticReadOnlySpan<byte>OrganizationalUnit=>newbyte[]{0x55,0x04,0x0B,};privatestaticReadOnlySpan<byte>OrganizationIdentifier=>newbyte[]{0x55,0x04,0x61,};privatestaticReadOnlySpan<byte>SubjectKeyIdentifier=>newbyte[]{0x55,0x1D,0x0E,};privatestaticReadOnlySpan<byte>KeyUsage=>newbyte[]{0x55,0x1D,0x0F,};privatestaticReadOnlySpan<byte>SubjectAlternativeName=>newbyte[]{0x55,0x1D,0x11,};privatestaticReadOnlySpan<byte>BasicConstraints=>newbyte[]{0x55,0x1D,0x13,};privatestaticReadOnlySpan<byte>CrlNumber=>newbyte[]{0x55,0x1D,0x14,};privatestaticReadOnlySpan<byte>AuthorityKeyIdentifier=>newbyte[]{0x55,0x1D,0x23,};privatestaticReadOnlySpan<byte>Aes128Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,};privatestaticReadOnlySpan<byte>Aes192Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,};privatestaticReadOnlySpan<byte>Aes256Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,};privatestaticReadOnlySpan<byte>Sha256=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,};privatestaticReadOnlySpan<byte>Sha384=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,};privatestaticReadOnlySpan<byte>Sha512=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,};privatestaticReadOnlySpan<byte>CabForumDV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x01,};privatestaticReadOnlySpan<byte>CabForumOV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x02,};internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){returnvalueswitch{"1.2.840.10040.4.1"=>DSA,"1.2.840.10040.4.3"=>DSAWithSha1,"1.2.840.10045.2.1"=>EC,"1.2.840.10045.1.1"=>EcPrimeField,"1.2.840.10045.1.2"=>EcChar2Field,"1.2.840.10045.3.1.7"=>Secp256r1,"1.2.840.10045.4.1"=>ECDSAWithSha1,"1.2.840.10045.4.3.2"=>ECDSAWithSha256,"1.2.840.10045.4.3.3"=>ECDSAWithSha384,"1.2.840.10045.4.3.4"=>ECDSAWithSha512,"1.2.840.113549.1.1.1"=>RSA,"1.2.840.113549.1.1.5"=>RSAWithSha1,"1.2.840.113549.1.1.7"=>RSAOAEP,"1.2.840.113549.1.1.8"=>MGF1,"1.2.840.113549.1.1.9"=>OaepPSpecified,"1.2.840.113549.1.1.10"=>RSAPSS,"1.2.840.113549.1.1.11"=>RSAWithSha256,"1.2.840.113549.1.1.12"=>RSAWithSha384,"1.2.840.113549.1.1.13"=>RSAWithSha512,"1.2.840.113549.1.5.3"=>PbeWithMD5AndDESCBC,"1.2.840.113549.1.5.10"=>PbeWithSha1AndDESCBC,"1.2.840.113549.1.5.11"=>PbeWithSha1AndRC2CBC,"1.2.840.113549.1.5.12"=>Pbkdf2,"1.2.840.113549.1.5.13"=>PasswordBasedEncryptionScheme2,"1.2.840.113549.1.7.1"=>Pkcs7Data,"1.2.840.113549.1.7.2"=>Pkcs7SignedData,"1.2.840.113549.1.7.3"=>Pkcs7EnvelopedData,"1.2.840.113549.1.7.6"=>Pkcs7EncryptedData,"1.2.840.113549.1.9.1"=>Pkcs9EmailAddress,"1.2.840.113549.1.9.3"=>Pkcs9ContentType,"1.2.840.113549.1.9.4"=>Pkcs9MessageDigest,"1.2.840.113549.1.9.5"=>Pkcs9SigningTime,"1.2.840.113549.1.9.6"=>Pkcs9CounterSigner,"1.2.840.113549.1.9.7"=>Pkcs9Challenge,"1.2.840.113549.1.9.14"=>Pkcs9ExtensionRequest,"1.2.840.113549.1.9.15"=>Pkcs9SMimeCapabilities,"1.2.840.113549.1.9.16.1.4"=>TstInfo,"1.2.840.113549.1.9.16.2.12"=>SigningCertificateAttr,"1.2.840.113549.1.9.16.2.14"=>SignatureTimeStampAttr,"1.2.840.113549.1.9.16.2.47"=>SigningCertificateV2Attr,"1.2.840.113549.1.9.20"=>Pkcs9FriendlyName,"1.2.840.113549.1.9.21"=>LocalKeyId,"1.2.840.113549.1.9.22.1"=>Pkcs12X509CertType,"1.2.840.113549.1.12.1.3"=>Pkcs12TripleDes,"1.2.840.113549.1.12.1.5"=>Pkcs12Rc2Cbc128,"1.2.840.113549.1.12.1.6"=>Pkcs12Rc2Cbc40,"1.2.840.113549.1.12.10.1.1"=>Pkcs12KeyBag,"1.2.840.113549.1.12.10.1.2"=>Pkcs12ShroudedKeyBag,"1.2.840.113549.1.12.10.1.3"=>Pkcs12CertBag,"1.2.840.113549.1.12.10.1.5"=>Pkcs12SecretBag,"1.2.840.113549.1.12.10.1.6"=>Pkcs12SafeContentsBag,"1.2.840.113549.2.5"=>MD5,"1.2.840.113549.2.7"=>HMACSHA1,"1.2.840.113549.2.9"=>HMACSHA256,"1.2.840.113549.2.10"=>HMACSHA384,"1.2.840.113549.2.11"=>HMACSHA512,"1.2.840.113549.3.2"=>RC2CBC,"1.2.840.113549.3.7"=>TripleDESCBC,"1.3.6.1.4.1.311.17.1"=>Pkcs12KeyProviderName,"1.3.6.1.4.1.311.17.3.20"=>KeyIdentifier,"1.3.6.1.4.1.311.20.2.3"=>UserPrincipalName,"1.3.6.1.4.1.311.88.2.1"=>DocumentNameAttr,"1.3.6.1.4.1.311.88.2.2"=>DocumentDescriptionAttr,"1.3.6.1.5.5.7.3.1"=>KeyPurposeTlsServer,"1.3.6.1.5.5.7.3.2"=>KeyPurposeTlsClient,"1.3.6.1.5.5.7.3.3"=>KeyPurposeCodeSign,"1.3.6.1.5.5.7.3.4"=>KeyPurposeEmailProtection,"1.3.6.1.5.5.7.3.8"=>KeyPurposeTimestamping,"1.3.6.1.5.5.7.3.9"=>KeyPurposeOcspSigner,"1.3.6.1.5.5.7.6.2"=>Pkcs7NoSignature,"1.3.6.1.5.5.7.48.1"=>OCSP,"1.3.6.1.5.5.7.48.1.2"=>OcspNonce,"1.3.6.1.5.5.7.48.2"=>CAIssuers,"1.3.14.3.2.26"=>SHA1,"1.3.14.3.2.7"=>DES,"1.3.132.0.34"=>Secp384r1,"1.3.132.0.35"=>Secp521r1,"2.5.4.3"=>CommonName,"2.5.4.5"=>SerialNumber,"2.5.4.6"=>CountryOrRegionName,"2.5.4.7"=>Locality,"2.5.4.8"=>StateOrProvinceName,"2.5.4.10"=>OrganizationName,"2.5.4.11"=>OrganizationalUnit,"2.5.4.97"=>OrganizationIdentifier,"2.5.29.14"=>SubjectKeyIdentifier,"2.5.29.15"=>KeyUsage,"2.5.29.17"=>SubjectAlternativeName,"2.5.29.19"=>BasicConstraints,"2.5.29.20"=>CrlNumber,"2.5.29.35"=>AuthorityKeyIdentifier,"2.16.840.1.101.3.4.1.2"=>Aes128Cbc,"2.16.840.1.101.3.4.1.22"=>Aes192Cbc,"2.16.840.1.101.3.4.1.42"=>Aes256Cbc,"2.16.840.1.101.3.4.2.1"=>Sha256,"2.16.840.1.101.3.4.2.2"=>Sha384,"2.16.840.1.101.3.4.2.3"=>Sha512,"2.23.140.1.2.1"=>CabForumDV,"2.23.140.1.2.2"=>CabForumOV,
_ =>ReadOnlySpan<byte>.Empty,};}}internalstaticclassWellKnownOids_PR{internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){ReadOnlySpan<byte>data=newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,// DSA0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,// DSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,// EC0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,// EcPrimeField0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,// EcChar2Field0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,// Secp256r10x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,// ECDSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,// ECDSAWithSha2560x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,// ECDSAWithSha3840x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,// ECDSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,// RSA0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,// RSAWithSha10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,// RSAOAEP0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,// MGF10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,// OaepPSpecified0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,// RSAPSS0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,// RSAWithSha2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,// RSAWithSha3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,// RSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,// PbeWithMD5AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,// PbeWithSha1AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,// PbeWithSha1AndRC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,// Pbkdf20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,// PasswordBasedEncryptionScheme20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,// Pkcs7Data0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,// Pkcs7SignedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,// Pkcs7EnvelopedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,// Pkcs7EncryptedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,// Pkcs9EmailAddress0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,// Pkcs9ContentType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,// Pkcs9MessageDigest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,// Pkcs9SigningTime0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,// Pkcs9CounterSigner0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,// Pkcs9Challenge0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,// Pkcs9ExtensionRequest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,// Pkcs9SMimeCapabilities0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,// TstInfo0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,// SigningCertificateAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,// SignatureTimeStampAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,// SigningCertificateV2Attr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,// Pkcs9FriendlyName0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,// LocalKeyId0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,// Pkcs12X509CertType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,// Pkcs12TripleDes0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,// Pkcs12Rc2Cbc1280x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,// Pkcs12Rc2Cbc400x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,// Pkcs12KeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,// Pkcs12ShroudedKeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,// Pkcs12CertBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,// Pkcs12SecretBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,// Pkcs12SafeContentsBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,// MD50x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,// HMACSHA10x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,// HMACSHA2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,// HMACSHA3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,// HMACSHA5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,// RC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,// TripleDESCBC0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,// Pkcs12KeyProviderName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,// KeyIdentifier0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,// UserPrincipalName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,// DocumentNameAttr0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,// DocumentDescriptionAttr0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,// KeyPurposeTlsServer0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,// KeyPurposeTlsClient0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,// KeyPurposeCodeSign0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,// KeyPurposeEmailProtection0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,// KeyPurposeTimestamping0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,// KeyPurposeOcspSigner0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,// Pkcs7NoSignature0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,// OCSP0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,// OcspNonce0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,// CAIssuers0x2B,0x0E,0x03,0x02,0x1A,// SHA10x2B,0x0E,0x03,0x02,0x07,// DES0x2B,0x81,0x04,0x00,0x22,// Secp384r10x2B,0x81,0x04,0x00,0x23,// Secp521r10x55,0x04,0x03,// CommonName0x55,0x04,0x05,// SerialNumber0x55,0x04,0x06,// CountryOrRegionName0x55,0x04,0x07,// Locality0x55,0x04,0x08,// StateOrProvinceName0x55,0x04,0x0A,// OrganizationName0x55,0x04,0x0B,// OrganizationalUnit0x55,0x04,0x61,// OrganizationIdentifier0x55,0x1D,0x0E,// SubjectKeyIdentifier0x55,0x1D,0x0F,// KeyUsage0x55,0x1D,0x11,// SubjectAlternativeName0x55,0x1D,0x13,// BasicConstraints0x55,0x1D,0x14,// CrlNumber0x55,0x1D,0x23,// AuthorityKeyIdentifier0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,// Aes128Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,// Aes192Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,// Aes256Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,// Sha2560x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,// Sha3840x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,// Sha5120x67,0x81,0x0C,0x01,0x02,0x01,// CabForumDV0x67,0x81,0x0C,0x01,0x02,0x02,// CabForumOV};returnvalueswitch{"1.2.840.10040.4.1"=>data.Slice(0,7),// DSA"1.2.840.10040.4.3"=>data.Slice(7,7),// DSAWithSha1"1.2.840.10045.2.1"=>data.Slice(14,7),// EC"1.2.840.10045.1.1"=>data.Slice(21,7),// EcPrimeField"1.2.840.10045.1.2"=>data.Slice(28,7),// EcChar2Field"1.2.840.10045.3.1.7"=>data.Slice(35,8),// Secp256r1"1.2.840.10045.4.1"=>data.Slice(43,7),// ECDSAWithSha1"1.2.840.10045.4.3.2"=>data.Slice(50,8),// ECDSAWithSha256"1.2.840.10045.4.3.3"=>data.Slice(58,8),// ECDSAWithSha384"1.2.840.10045.4.3.4"=>data.Slice(66,8),// ECDSAWithSha512"1.2.840.113549.1.1.1"=>data.Slice(74,9),// RSA"1.2.840.113549.1.1.5"=>data.Slice(83,9),// RSAWithSha1"1.2.840.113549.1.1.7"=>data.Slice(92,9),// RSAOAEP"1.2.840.113549.1.1.8"=>data.Slice(101,9),// MGF1"1.2.840.113549.1.1.9"=>data.Slice(110,9),// OaepPSpecified"1.2.840.113549.1.1.10"=>data.Slice(119,9),// RSAPSS"1.2.840.113549.1.1.11"=>data.Slice(128,9),// RSAWithSha256"1.2.840.113549.1.1.12"=>data.Slice(137,9),// RSAWithSha384"1.2.840.113549.1.1.13"=>data.Slice(146,9),// RSAWithSha512"1.2.840.113549.1.5.3"=>data.Slice(155,9),// PbeWithMD5AndDESCBC"1.2.840.113549.1.5.10"=>data.Slice(164,9),// PbeWithSha1AndDESCBC"1.2.840.113549.1.5.11"=>data.Slice(173,9),// PbeWithSha1AndRC2CBC"1.2.840.113549.1.5.12"=>data.Slice(182,9),// Pbkdf2"1.2.840.113549.1.5.13"=>data.Slice(191,9),// PasswordBasedEncryptionScheme2"1.2.840.113549.1.7.1"=>data.Slice(200,9),// Pkcs7Data"1.2.840.113549.1.7.2"=>data.Slice(209,9),// Pkcs7SignedData"1.2.840.113549.1.7.3"=>data.Slice(218,9),// Pkcs7EnvelopedData"1.2.840.113549.1.7.6"=>data.Slice(227,9),// Pkcs7EncryptedData"1.2.840.113549.1.9.1"=>data.Slice(236,9),// Pkcs9EmailAddress"1.2.840.113549.1.9.3"=>data.Slice(245,9),// Pkcs9ContentType"1.2.840.113549.1.9.4"=>data.Slice(254,9),// Pkcs9MessageDigest"1.2.840.113549.1.9.5"=>data.Slice(263,9),// Pkcs9SigningTime"1.2.840.113549.1.9.6"=>data.Slice(272,9),// Pkcs9CounterSigner"1.2.840.113549.1.9.7"=>data.Slice(281,9),// Pkcs9Challenge"1.2.840.113549.1.9.14"=>data.Slice(290,9),// Pkcs9ExtensionRequest"1.2.840.113549.1.9.15"=>data.Slice(299,9),// Pkcs9SMimeCapabilities"1.2.840.113549.1.9.16.1.4"=>data.Slice(308,11),// TstInfo"1.2.840.113549.1.9.16.2.12"=>data.Slice(319,11),// SigningCertificateAttr"1.2.840.113549.1.9.16.2.14"=>data.Slice(330,11),// SignatureTimeStampAttr"1.2.840.113549.1.9.16.2.47"=>data.Slice(341,11),// SigningCertificateV2Attr"1.2.840.113549.1.9.20"=>data.Slice(352,9),// Pkcs9FriendlyName"1.2.840.113549.1.9.21"=>data.Slice(361,9),// LocalKeyId"1.2.840.113549.1.9.22.1"=>data.Slice(370,10),// Pkcs12X509CertType"1.2.840.113549.1.12.1.3"=>data.Slice(380,10),// Pkcs12TripleDes"1.2.840.113549.1.12.1.5"=>data.Slice(390,10),// Pkcs12Rc2Cbc128"1.2.840.113549.1.12.1.6"=>data.Slice(400,10),// Pkcs12Rc2Cbc40"1.2.840.113549.1.12.10.1.1"=>data.Slice(410,11),// Pkcs12KeyBag"1.2.840.113549.1.12.10.1.2"=>data.Slice(421,11),// Pkcs12ShroudedKeyBag"1.2.840.113549.1.12.10.1.3"=>data.Slice(432,11),// Pkcs12CertBag"1.2.840.113549.1.12.10.1.5"=>data.Slice(443,11),// Pkcs12SecretBag"1.2.840.113549.1.12.10.1.6"=>data.Slice(454,11),// Pkcs12SafeContentsBag"1.2.840.113549.2.5"=>data.Slice(465,8),// MD5"1.2.840.113549.2.7"=>data.Slice(473,8),// HMACSHA1"1.2.840.113549.2.9"=>data.Slice(481,8),// HMACSHA256"1.2.840.113549.2.10"=>data.Slice(489,8),// HMACSHA384"1.2.840.113549.2.11"=>data.Slice(497,8),// HMACSHA512"1.2.840.113549.3.2"=>data.Slice(505,8),// RC2CBC"1.2.840.113549.3.7"=>data.Slice(513,8),// TripleDESCBC"1.3.6.1.4.1.311.17.1"=>data.Slice(521,9),// Pkcs12KeyProviderName"1.3.6.1.4.1.311.17.3.20"=>data.Slice(530,10),// KeyIdentifier"1.3.6.1.4.1.311.20.2.3"=>data.Slice(540,10),// UserPrincipalName"1.3.6.1.4.1.311.88.2.1"=>data.Slice(550,10),// DocumentNameAttr"1.3.6.1.4.1.311.88.2.2"=>data.Slice(560,10),// DocumentDescriptionAttr"1.3.6.1.5.5.7.3.1"=>data.Slice(570,8),// KeyPurposeTlsServer"1.3.6.1.5.5.7.3.2"=>data.Slice(578,8),// KeyPurposeTlsClient"1.3.6.1.5.5.7.3.3"=>data.Slice(586,8),// KeyPurposeCodeSign"1.3.6.1.5.5.7.3.4"=>data.Slice(594,8),// KeyPurposeEmailProtection"1.3.6.1.5.5.7.3.8"=>data.Slice(602,8),// KeyPurposeTimestamping"1.3.6.1.5.5.7.3.9"=>data.Slice(610,8),// KeyPurposeOcspSigner"1.3.6.1.5.5.7.6.2"=>data.Slice(618,8),// Pkcs7NoSignature"1.3.6.1.5.5.7.48.1"=>data.Slice(626,8),// OCSP"1.3.6.1.5.5.7.48.1.2"=>data.Slice(634,9),// OcspNonce"1.3.6.1.5.5.7.48.2"=>data.Slice(643,8),// CAIssuers"1.3.14.3.2.26"=>data.Slice(651,5),// SHA1"1.3.14.3.2.7"=>data.Slice(656,5),// DES"1.3.132.0.34"=>data.Slice(661,5),// Secp384r1"1.3.132.0.35"=>data.Slice(666,5),// Secp521r1"2.5.4.3"=>data.Slice(671,3),// CommonName"2.5.4.5"=>data.Slice(674,3),// SerialNumber"2.5.4.6"=>data.Slice(677,3),// CountryOrRegionName"2.5.4.7"=>data.Slice(680,3),// Locality"2.5.4.8"=>data.Slice(683,3),// StateOrProvinceName"2.5.4.10"=>data.Slice(686,3),// OrganizationName"2.5.4.11"=>data.Slice(689,3),// OrganizationalUnit"2.5.4.97"=>data.Slice(692,3),// OrganizationIdentifier"2.5.29.14"=>data.Slice(695,3),// SubjectKeyIdentifier"2.5.29.15"=>data.Slice(698,3),// KeyUsage"2.5.29.17"=>data.Slice(701,3),// SubjectAlternativeName"2.5.29.19"=>data.Slice(704,3),// BasicConstraints"2.5.29.20"=>data.Slice(707,3),// CrlNumber"2.5.29.35"=>data.Slice(710,3),// AuthorityKeyIdentifier"2.16.840.1.101.3.4.1.2"=>data.Slice(713,9),// Aes128Cbc"2.16.840.1.101.3.4.1.22"=>data.Slice(722,9),// Aes192Cbc"2.16.840.1.101.3.4.1.42"=>data.Slice(731,9),// Aes256Cbc"2.16.840.1.101.3.4.2.1"=>data.Slice(740,9),// Sha256"2.16.840.1.101.3.4.2.2"=>data.Slice(749,9),// Sha384"2.16.840.1.101.3.4.2.3"=>data.Slice(758,9),// Sha512"2.23.140.1.2.1"=>data.Slice(767,6),// CabForumDV"2.23.140.1.2.2"=>data.Slice(773,6),// CabForumOV
_ =>ReadOnlySpan<byte>.Empty};}}}

Thank you for your contribution to size reduction @am11 !

@adamsitnikadamsitnik self-assigned this May 17, 2023
@adamsitnik
adamsitnik merged commit 976409d into dotnet:mainMay 17, 2023
@ghostghost locked as resolved and limited conversation to collaborators Jun 16, 2023
@am11
am11 deleted the patch-19 branch June 14, 2024 04:53
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Formats.Asn1size-reductionIssues impacting final app size primary for size sensitive workloads

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@am11@stephentoub@EgorBo@jeffhandley@adamsitnik@bartonjs@teo-tsirpanis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Restructure WellKnownOids.cs - #84921

Merged
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19
May 17, 2023
Merged

Restructure WellKnownOids.cs#84921
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19

Conversation

@am11

@am11am11 commented Apr 17, 2023

Copy link
Copy Markdown
Member

By moving private static ROS to local ROS variable and changing switch expression to switch-case syntax, we save 7.3 KB in NativeAOT app.

It removes System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 largest shared framework methods list:

$ ./build.sh clr+libs+packs -c Release -p:IlcGenerateMapFile=true
$ xmlstarlet sel -t -m "//ObjectNodes/MethodCode" -v 'concat(@Length, ": ", @Name)' -n artifacts/obj/coreclr/crossgen2/arm64/Release/native/crossgen2.map.xml |\
sort -nr | head -10 | grep -E ': (System|S_P)_'| xml unescape

@am11am11 added size-reduction Issues impacting final app size primary for size sensitive workloads area-System.Formats.Asn1 and removed area-System.Formats.Asn1 labels Apr 17, 2023
"2.23.140.1.2.1" => CabForumDV,
"2.23.140.1.2.2" => CabForumOV,
_ => ReadOnlySpan<byte>.Empty,
case "1.2.840.10040.4.1": return DSA;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about you inline the new byte[]s?

@stephentoub

stephentoub commented Apr 17, 2023

Copy link
Copy Markdown
Member

It's fine to switch to using local or inline spans, but I'm not a big fan of changing the switch syntax in the name of saving a few bytes based on how it's currently lowered by the C# compiler. What's the impact of just the syntax change? I'd expect it to just be the difference between N stores into a local and one return vs N returns.

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

Reverted the switch-case change.

@stephentoub

Copy link
Copy Markdown
Member

Can you instead structure it like:

returnvalueswitch{"1.2.840.10040.4.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,},// DSA"1.2.840.10040.4.3"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,},// DSAWithSha1"1.2.840.10045.2.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,},// EC"1.2.840.10045.1.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,},// EcPrimeField"1.2.840.10045.1.2"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,},// EcChar2Field"1.2.840.10045.3.1.7"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,},// Secp256r1
...

?

@EgorBo

Copy link
Copy Markdown
Member

Part of the problem (I've checked the current impl in this PR) is:

Inlines into System.Formats.Asn1.WellKnownOids:GetContents(System.ReadOnlySpan`1[ushort]):System.ReadOnlySpan`1[ubyte]:
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:get_Empty():System.ReadOnlySpan`1[ubyte]

JIT blows up from the number of temp locals, perhaps you can split it into two functions?

@stephentoub

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

@EgorBo

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

Looks like it makes it even worse (more locals), presumably, because Roslyn spills it anyway.
We either need to bump the limit of locals JIT can track or/and I also need to limit "string.Equals" unrolling optimization when we have too many locals already

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

UPD: looks like it's not Span/String.Equals's fault

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

I'm trying another approach by having one local and slicing.

I opened this PR by making change in browser, while my local HEAD was a few days old. Though it still saves 7+ K compared to main, it's no longer dropping System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 list, see the PR description. Looks like some recent change in JIT..

@EgorBo

Copy link
Copy Markdown
Member

Ok, I've bumped the "number of locals JIT can track" limit and it removed all not-inlined methods (all of them are now inlined) and reduced total size of the method in half

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

Looks like some recent change in JIT..

@am11 I think it's either #84530 or #83945

@jeffhandley

Copy link
Copy Markdown
Member

Tagging @dotnet/area-system-formats-asn1 since msftbot was down when the label was applied

Comment on lines +299 to +300
"1.3.132.0.35" => data.Slice(666, 5), // Secp521r1
"2.5.4.3" => data.Slice(671, 3), // CommonName

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a little bothered by how this will make future insertions hard to maintain in the same style. Right now, everything is sorted by the dotted decimal string (or the binary encoding, since they sort the same way). So, if in the future 2.5.4.2 is determined to be common enough to be worth encoding in the table, someone will have to decide between a) putting the new value at the end of the unified blob (being the first unsorted entry) or b) adding 3 to lines 300-321.

That said, adding things to this should be rare; so the savings might pay for the future frustration.

@adamsitnikadamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That said, adding things to this should be rare; so the savings might pay for the future frustration.

I agree with @bartonjs

I wrote a simple console app to verify that the change is not introducing any bug:

Details
namespaceWellKnownTests{internalclassProgram{staticvoidMain(string[]args){Test("1.2.840.10040.4.1");Test("1.2.840.10040.4.3");Test("1.2.840.10045.2.1");Test("1.2.840.10045.1.1");Test("1.2.840.10045.1.2");Test("1.2.840.10045.3.1.7");Test("1.2.840.10045.4.1");Test("1.2.840.10045.4.3.2");Test("1.2.840.10045.4.3.3");Test("1.2.840.10045.4.3.4");Test("1.2.840.113549.1.1.1");Test("1.2.840.113549.1.1.5");Test("1.2.840.113549.1.1.7");Test("1.2.840.113549.1.1.8");Test("1.2.840.113549.1.1.9");Test("1.2.840.113549.1.1.10");Test("1.2.840.113549.1.1.11");Test("1.2.840.113549.1.1.12");Test("1.2.840.113549.1.1.13");Test("1.2.840.113549.1.5.3");Test("1.2.840.113549.1.5.10");Test("1.2.840.113549.1.5.11");Test("1.2.840.113549.1.5.12");Test("1.2.840.113549.1.5.13");Test("1.2.840.113549.1.7.1");Test("1.2.840.113549.1.7.2");Test("1.2.840.113549.1.7.3");Test("1.2.840.113549.1.7.6");Test("1.2.840.113549.1.9.1");Test("1.2.840.113549.1.9.3");Test("1.2.840.113549.1.9.4");Test("1.2.840.113549.1.9.5");Test("1.2.840.113549.1.9.6");Test("1.2.840.113549.1.9.7");Test("1.2.840.113549.1.9.14");Test("1.2.840.113549.1.9.15");Test("1.2.840.113549.1.9.16.1.4");Test("1.2.840.113549.1.9.16.2.12");Test("1.2.840.113549.1.9.16.2.14");Test("1.2.840.113549.1.9.16.2.47");Test("1.2.840.113549.1.9.20");Test("1.2.840.113549.1.9.21");Test("1.2.840.113549.1.9.22.1");Test("1.2.840.113549.1.12.1.3");Test("1.2.840.113549.1.12.1.5");Test("1.2.840.113549.1.12.1.6");Test("1.2.840.113549.1.12.10.1.1");Test("1.2.840.113549.1.12.10.1.2");Test("1.2.840.113549.1.12.10.1.3");Test("1.2.840.113549.1.12.10.1.5");Test("1.2.840.113549.1.12.10.1.6");Test("1.2.840.113549.2.5");Test("1.2.840.113549.2.7");Test("1.2.840.113549.2.9");Test("1.2.840.113549.2.10");Test("1.2.840.113549.2.11");Test("1.2.840.113549.3.2");Test("1.2.840.113549.3.7");Test("1.3.6.1.4.1.311.17.1");Test("1.3.6.1.4.1.311.17.3.20");Test("1.3.6.1.4.1.311.20.2.3");Test("1.3.6.1.4.1.311.88.2.1");Test("1.3.6.1.4.1.311.88.2.2");Test("1.3.6.1.5.5.7.3.1");Test("1.3.6.1.5.5.7.3.2");Test("1.3.6.1.5.5.7.3.3");Test("1.3.6.1.5.5.7.3.4");Test("1.3.6.1.5.5.7.3.8");Test("1.3.6.1.5.5.7.3.9");Test("1.3.6.1.5.5.7.6.2");Test("1.3.6.1.5.5.7.48.1");Test("1.3.6.1.5.5.7.48.1.2");Test("1.3.6.1.5.5.7.48.2");Test("1.3.14.3.2.26");Test("1.3.14.3.2.7");Test("1.3.132.0.34");Test("1.3.132.0.35");Test("2.5.4.3");Test("2.5.4.5");Test("2.5.4.6");Test("2.5.4.7");Test("2.5.4.8");Test("2.5.4.10");Test("2.5.4.11");Test("2.5.4.97");Test("2.5.29.14");Test("2.5.29.15");Test("2.5.29.17");Test("2.5.29.19");Test("2.5.29.20");Test("2.5.29.35");Test("2.16.840.1.101.3.4.1.2");Test("2.16.840.1.101.3.4.1.22");Test("2.16.840.1.101.3.4.1.42");Test("2.16.840.1.101.3.4.2.1");Test("2.16.840.1.101.3.4.2.2");Test("2.16.840.1.101.3.4.2.3");Test("2.23.140.1.2.1");Test("2.23.140.1.2.2");staticvoidTest(stringvalue){ReadOnlySpan<byte>mainContents=WellKnownOids_Main.GetContents(value);ReadOnlySpan<byte>prContents=WellKnownOids_PR.GetContents(value);if(!mainContents.SequenceEqual(prContents)){thrownewException($"GetContents Bug for {value}");}string?mainValue=WellKnownOids_Main.GetValue(mainContents);string?prValue=WellKnownOids_PR.GetValue(prContents);if(prValue!=mainValue){thrownewException($"GetValue Bug for {value}");}}}}internalstaticclassWellKnownOids_Main{privatestaticReadOnlySpan<byte>DSA=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,};privatestaticReadOnlySpan<byte>DSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,};privatestaticReadOnlySpan<byte>EC=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,};privatestaticReadOnlySpan<byte>EcPrimeField=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,};privatestaticReadOnlySpan<byte>EcChar2Field=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,};privatestaticReadOnlySpan<byte>Secp256r1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,};privatestaticReadOnlySpan<byte>ECDSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,};privatestaticReadOnlySpan<byte>ECDSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,};privatestaticReadOnlySpan<byte>ECDSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,};privatestaticReadOnlySpan<byte>ECDSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,};privatestaticReadOnlySpan<byte>RSA=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,};privatestaticReadOnlySpan<byte>RSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,};privatestaticReadOnlySpan<byte>RSAOAEP=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,};privatestaticReadOnlySpan<byte>MGF1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,};privatestaticReadOnlySpan<byte>OaepPSpecified=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,};privatestaticReadOnlySpan<byte>RSAPSS=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,};privatestaticReadOnlySpan<byte>RSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,};privatestaticReadOnlySpan<byte>RSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,};privatestaticReadOnlySpan<byte>RSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,};privatestaticReadOnlySpan<byte>PbeWithMD5AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,};privatestaticReadOnlySpan<byte>PbeWithSha1AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,};privatestaticReadOnlySpan<byte>PbeWithSha1AndRC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,};privatestaticReadOnlySpan<byte>Pbkdf2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,};privatestaticReadOnlySpan<byte>PasswordBasedEncryptionScheme2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,};privatestaticReadOnlySpan<byte>Pkcs7Data=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,};privatestaticReadOnlySpan<byte>Pkcs7SignedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,};privatestaticReadOnlySpan<byte>Pkcs7EnvelopedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,};privatestaticReadOnlySpan<byte>Pkcs7EncryptedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,};privatestaticReadOnlySpan<byte>Pkcs9EmailAddress=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,};privatestaticReadOnlySpan<byte>Pkcs9ContentType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,};privatestaticReadOnlySpan<byte>Pkcs9MessageDigest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,};privatestaticReadOnlySpan<byte>Pkcs9SigningTime=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,};privatestaticReadOnlySpan<byte>Pkcs9CounterSigner=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,};privatestaticReadOnlySpan<byte>Pkcs9Challenge=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,};privatestaticReadOnlySpan<byte>Pkcs9ExtensionRequest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,};privatestaticReadOnlySpan<byte>Pkcs9SMimeCapabilities=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,};privatestaticReadOnlySpan<byte>TstInfo=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,};privatestaticReadOnlySpan<byte>SigningCertificateAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,};privatestaticReadOnlySpan<byte>SignatureTimeStampAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,};privatestaticReadOnlySpan<byte>SigningCertificateV2Attr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,};privatestaticReadOnlySpan<byte>Pkcs9FriendlyName=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,};privatestaticReadOnlySpan<byte>LocalKeyId=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,};privatestaticReadOnlySpan<byte>Pkcs12X509CertType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,};privatestaticReadOnlySpan<byte>Pkcs12TripleDes=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc128=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc40=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,};privatestaticReadOnlySpan<byte>Pkcs12KeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,};privatestaticReadOnlySpan<byte>Pkcs12ShroudedKeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,};privatestaticReadOnlySpan<byte>Pkcs12CertBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12SecretBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12SafeContentsBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,};privatestaticReadOnlySpan<byte>MD5=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,};privatestaticReadOnlySpan<byte>HMACSHA1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,};privatestaticReadOnlySpan<byte>HMACSHA256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,};privatestaticReadOnlySpan<byte>HMACSHA384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,};privatestaticReadOnlySpan<byte>HMACSHA512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,};privatestaticReadOnlySpan<byte>RC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,};privatestaticReadOnlySpan<byte>TripleDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,};privatestaticReadOnlySpan<byte>Pkcs12KeyProviderName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,};privatestaticReadOnlySpan<byte>KeyIdentifier=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,};privatestaticReadOnlySpan<byte>UserPrincipalName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,};privatestaticReadOnlySpan<byte>DocumentNameAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,};privatestaticReadOnlySpan<byte>DocumentDescriptionAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeTlsServer=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,};privatestaticReadOnlySpan<byte>KeyPurposeTlsClient=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeCodeSign=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,};privatestaticReadOnlySpan<byte>KeyPurposeEmailProtection=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,};privatestaticReadOnlySpan<byte>KeyPurposeTimestamping=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,};privatestaticReadOnlySpan<byte>KeyPurposeOcspSigner=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,};privatestaticReadOnlySpan<byte>Pkcs7NoSignature=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,};privatestaticReadOnlySpan<byte>OCSP=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,};privatestaticReadOnlySpan<byte>OcspNonce=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,};privatestaticReadOnlySpan<byte>CAIssuers=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,};privatestaticReadOnlySpan<byte>SHA1=>newbyte[]{0x2B,0x0E,0x03,0x02,0x1A,};privatestaticReadOnlySpan<byte>DES=>newbyte[]{0x2B,0x0E,0x03,0x02,0x07,};privatestaticReadOnlySpan<byte>Secp384r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x22,};privatestaticReadOnlySpan<byte>Secp521r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x23,};privatestaticReadOnlySpan<byte>CommonName=>newbyte[]{0x55,0x04,0x03,};privatestaticReadOnlySpan<byte>SerialNumber=>newbyte[]{0x55,0x04,0x05,};privatestaticReadOnlySpan<byte>CountryOrRegionName=>newbyte[]{0x55,0x04,0x06,};privatestaticReadOnlySpan<byte>Locality=>newbyte[]{0x55,0x04,0x07,};privatestaticReadOnlySpan<byte>StateOrProvinceName=>newbyte[]{0x55,0x04,0x08,};privatestaticReadOnlySpan<byte>OrganizationName=>newbyte[]{0x55,0x04,0x0A,};privatestaticReadOnlySpan<byte>OrganizationalUnit=>newbyte[]{0x55,0x04,0x0B,};privatestaticReadOnlySpan<byte>OrganizationIdentifier=>newbyte[]{0x55,0x04,0x61,};privatestaticReadOnlySpan<byte>SubjectKeyIdentifier=>newbyte[]{0x55,0x1D,0x0E,};privatestaticReadOnlySpan<byte>KeyUsage=>newbyte[]{0x55,0x1D,0x0F,};privatestaticReadOnlySpan<byte>SubjectAlternativeName=>newbyte[]{0x55,0x1D,0x11,};privatestaticReadOnlySpan<byte>BasicConstraints=>newbyte[]{0x55,0x1D,0x13,};privatestaticReadOnlySpan<byte>CrlNumber=>newbyte[]{0x55,0x1D,0x14,};privatestaticReadOnlySpan<byte>AuthorityKeyIdentifier=>newbyte[]{0x55,0x1D,0x23,};privatestaticReadOnlySpan<byte>Aes128Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,};privatestaticReadOnlySpan<byte>Aes192Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,};privatestaticReadOnlySpan<byte>Aes256Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,};privatestaticReadOnlySpan<byte>Sha256=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,};privatestaticReadOnlySpan<byte>Sha384=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,};privatestaticReadOnlySpan<byte>Sha512=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,};privatestaticReadOnlySpan<byte>CabForumDV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x01,};privatestaticReadOnlySpan<byte>CabForumOV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x02,};internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){returnvalueswitch{"1.2.840.10040.4.1"=>DSA,"1.2.840.10040.4.3"=>DSAWithSha1,"1.2.840.10045.2.1"=>EC,"1.2.840.10045.1.1"=>EcPrimeField,"1.2.840.10045.1.2"=>EcChar2Field,"1.2.840.10045.3.1.7"=>Secp256r1,"1.2.840.10045.4.1"=>ECDSAWithSha1,"1.2.840.10045.4.3.2"=>ECDSAWithSha256,"1.2.840.10045.4.3.3"=>ECDSAWithSha384,"1.2.840.10045.4.3.4"=>ECDSAWithSha512,"1.2.840.113549.1.1.1"=>RSA,"1.2.840.113549.1.1.5"=>RSAWithSha1,"1.2.840.113549.1.1.7"=>RSAOAEP,"1.2.840.113549.1.1.8"=>MGF1,"1.2.840.113549.1.1.9"=>OaepPSpecified,"1.2.840.113549.1.1.10"=>RSAPSS,"1.2.840.113549.1.1.11"=>RSAWithSha256,"1.2.840.113549.1.1.12"=>RSAWithSha384,"1.2.840.113549.1.1.13"=>RSAWithSha512,"1.2.840.113549.1.5.3"=>PbeWithMD5AndDESCBC,"1.2.840.113549.1.5.10"=>PbeWithSha1AndDESCBC,"1.2.840.113549.1.5.11"=>PbeWithSha1AndRC2CBC,"1.2.840.113549.1.5.12"=>Pbkdf2,"1.2.840.113549.1.5.13"=>PasswordBasedEncryptionScheme2,"1.2.840.113549.1.7.1"=>Pkcs7Data,"1.2.840.113549.1.7.2"=>Pkcs7SignedData,"1.2.840.113549.1.7.3"=>Pkcs7EnvelopedData,"1.2.840.113549.1.7.6"=>Pkcs7EncryptedData,"1.2.840.113549.1.9.1"=>Pkcs9EmailAddress,"1.2.840.113549.1.9.3"=>Pkcs9ContentType,"1.2.840.113549.1.9.4"=>Pkcs9MessageDigest,"1.2.840.113549.1.9.5"=>Pkcs9SigningTime,"1.2.840.113549.1.9.6"=>Pkcs9CounterSigner,"1.2.840.113549.1.9.7"=>Pkcs9Challenge,"1.2.840.113549.1.9.14"=>Pkcs9ExtensionRequest,"1.2.840.113549.1.9.15"=>Pkcs9SMimeCapabilities,"1.2.840.113549.1.9.16.1.4"=>TstInfo,"1.2.840.113549.1.9.16.2.12"=>SigningCertificateAttr,"1.2.840.113549.1.9.16.2.14"=>SignatureTimeStampAttr,"1.2.840.113549.1.9.16.2.47"=>SigningCertificateV2Attr,"1.2.840.113549.1.9.20"=>Pkcs9FriendlyName,"1.2.840.113549.1.9.21"=>LocalKeyId,"1.2.840.113549.1.9.22.1"=>Pkcs12X509CertType,"1.2.840.113549.1.12.1.3"=>Pkcs12TripleDes,"1.2.840.113549.1.12.1.5"=>Pkcs12Rc2Cbc128,"1.2.840.113549.1.12.1.6"=>Pkcs12Rc2Cbc40,"1.2.840.113549.1.12.10.1.1"=>Pkcs12KeyBag,"1.2.840.113549.1.12.10.1.2"=>Pkcs12ShroudedKeyBag,"1.2.840.113549.1.12.10.1.3"=>Pkcs12CertBag,"1.2.840.113549.1.12.10.1.5"=>Pkcs12SecretBag,"1.2.840.113549.1.12.10.1.6"=>Pkcs12SafeContentsBag,"1.2.840.113549.2.5"=>MD5,"1.2.840.113549.2.7"=>HMACSHA1,"1.2.840.113549.2.9"=>HMACSHA256,"1.2.840.113549.2.10"=>HMACSHA384,"1.2.840.113549.2.11"=>HMACSHA512,"1.2.840.113549.3.2"=>RC2CBC,"1.2.840.113549.3.7"=>TripleDESCBC,"1.3.6.1.4.1.311.17.1"=>Pkcs12KeyProviderName,"1.3.6.1.4.1.311.17.3.20"=>KeyIdentifier,"1.3.6.1.4.1.311.20.2.3"=>UserPrincipalName,"1.3.6.1.4.1.311.88.2.1"=>DocumentNameAttr,"1.3.6.1.4.1.311.88.2.2"=>DocumentDescriptionAttr,"1.3.6.1.5.5.7.3.1"=>KeyPurposeTlsServer,"1.3.6.1.5.5.7.3.2"=>KeyPurposeTlsClient,"1.3.6.1.5.5.7.3.3"=>KeyPurposeCodeSign,"1.3.6.1.5.5.7.3.4"=>KeyPurposeEmailProtection,"1.3.6.1.5.5.7.3.8"=>KeyPurposeTimestamping,"1.3.6.1.5.5.7.3.9"=>KeyPurposeOcspSigner,"1.3.6.1.5.5.7.6.2"=>Pkcs7NoSignature,"1.3.6.1.5.5.7.48.1"=>OCSP,"1.3.6.1.5.5.7.48.1.2"=>OcspNonce,"1.3.6.1.5.5.7.48.2"=>CAIssuers,"1.3.14.3.2.26"=>SHA1,"1.3.14.3.2.7"=>DES,"1.3.132.0.34"=>Secp384r1,"1.3.132.0.35"=>Secp521r1,"2.5.4.3"=>CommonName,"2.5.4.5"=>SerialNumber,"2.5.4.6"=>CountryOrRegionName,"2.5.4.7"=>Locality,"2.5.4.8"=>StateOrProvinceName,"2.5.4.10"=>OrganizationName,"2.5.4.11"=>OrganizationalUnit,"2.5.4.97"=>OrganizationIdentifier,"2.5.29.14"=>SubjectKeyIdentifier,"2.5.29.15"=>KeyUsage,"2.5.29.17"=>SubjectAlternativeName,"2.5.29.19"=>BasicConstraints,"2.5.29.20"=>CrlNumber,"2.5.29.35"=>AuthorityKeyIdentifier,"2.16.840.1.101.3.4.1.2"=>Aes128Cbc,"2.16.840.1.101.3.4.1.22"=>Aes192Cbc,"2.16.840.1.101.3.4.1.42"=>Aes256Cbc,"2.16.840.1.101.3.4.2.1"=>Sha256,"2.16.840.1.101.3.4.2.2"=>Sha384,"2.16.840.1.101.3.4.2.3"=>Sha512,"2.23.140.1.2.1"=>CabForumDV,"2.23.140.1.2.2"=>CabForumOV,
_ =>ReadOnlySpan<byte>.Empty,};}}internalstaticclassWellKnownOids_PR{internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){ReadOnlySpan<byte>data=newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,// DSA0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,// DSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,// EC0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,// EcPrimeField0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,// EcChar2Field0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,// Secp256r10x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,// ECDSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,// ECDSAWithSha2560x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,// ECDSAWithSha3840x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,// ECDSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,// RSA0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,// RSAWithSha10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,// RSAOAEP0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,// MGF10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,// OaepPSpecified0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,// RSAPSS0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,// RSAWithSha2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,// RSAWithSha3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,// RSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,// PbeWithMD5AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,// PbeWithSha1AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,// PbeWithSha1AndRC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,// Pbkdf20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,// PasswordBasedEncryptionScheme20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,// Pkcs7Data0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,// Pkcs7SignedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,// Pkcs7EnvelopedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,// Pkcs7EncryptedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,// Pkcs9EmailAddress0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,// Pkcs9ContentType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,// Pkcs9MessageDigest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,// Pkcs9SigningTime0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,// Pkcs9CounterSigner0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,// Pkcs9Challenge0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,// Pkcs9ExtensionRequest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,// Pkcs9SMimeCapabilities0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,// TstInfo0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,// SigningCertificateAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,// SignatureTimeStampAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,// SigningCertificateV2Attr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,// Pkcs9FriendlyName0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,// LocalKeyId0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,// Pkcs12X509CertType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,// Pkcs12TripleDes0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,// Pkcs12Rc2Cbc1280x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,// Pkcs12Rc2Cbc400x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,// Pkcs12KeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,// Pkcs12ShroudedKeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,// Pkcs12CertBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,// Pkcs12SecretBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,// Pkcs12SafeContentsBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,// MD50x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,// HMACSHA10x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,// HMACSHA2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,// HMACSHA3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,// HMACSHA5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,// RC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,// TripleDESCBC0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,// Pkcs12KeyProviderName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,// KeyIdentifier0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,// UserPrincipalName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,// DocumentNameAttr0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,// DocumentDescriptionAttr0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,// KeyPurposeTlsServer0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,// KeyPurposeTlsClient0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,// KeyPurposeCodeSign0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,// KeyPurposeEmailProtection0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,// KeyPurposeTimestamping0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,// KeyPurposeOcspSigner0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,// Pkcs7NoSignature0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,// OCSP0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,// OcspNonce0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,// CAIssuers0x2B,0x0E,0x03,0x02,0x1A,// SHA10x2B,0x0E,0x03,0x02,0x07,// DES0x2B,0x81,0x04,0x00,0x22,// Secp384r10x2B,0x81,0x04,0x00,0x23,// Secp521r10x55,0x04,0x03,// CommonName0x55,0x04,0x05,// SerialNumber0x55,0x04,0x06,// CountryOrRegionName0x55,0x04,0x07,// Locality0x55,0x04,0x08,// StateOrProvinceName0x55,0x04,0x0A,// OrganizationName0x55,0x04,0x0B,// OrganizationalUnit0x55,0x04,0x61,// OrganizationIdentifier0x55,0x1D,0x0E,// SubjectKeyIdentifier0x55,0x1D,0x0F,// KeyUsage0x55,0x1D,0x11,// SubjectAlternativeName0x55,0x1D,0x13,// BasicConstraints0x55,0x1D,0x14,// CrlNumber0x55,0x1D,0x23,// AuthorityKeyIdentifier0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,// Aes128Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,// Aes192Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,// Aes256Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,// Sha2560x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,// Sha3840x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,// Sha5120x67,0x81,0x0C,0x01,0x02,0x01,// CabForumDV0x67,0x81,0x0C,0x01,0x02,0x02,// CabForumOV};returnvalueswitch{"1.2.840.10040.4.1"=>data.Slice(0,7),// DSA"1.2.840.10040.4.3"=>data.Slice(7,7),// DSAWithSha1"1.2.840.10045.2.1"=>data.Slice(14,7),// EC"1.2.840.10045.1.1"=>data.Slice(21,7),// EcPrimeField"1.2.840.10045.1.2"=>data.Slice(28,7),// EcChar2Field"1.2.840.10045.3.1.7"=>data.Slice(35,8),// Secp256r1"1.2.840.10045.4.1"=>data.Slice(43,7),// ECDSAWithSha1"1.2.840.10045.4.3.2"=>data.Slice(50,8),// ECDSAWithSha256"1.2.840.10045.4.3.3"=>data.Slice(58,8),// ECDSAWithSha384"1.2.840.10045.4.3.4"=>data.Slice(66,8),// ECDSAWithSha512"1.2.840.113549.1.1.1"=>data.Slice(74,9),// RSA"1.2.840.113549.1.1.5"=>data.Slice(83,9),// RSAWithSha1"1.2.840.113549.1.1.7"=>data.Slice(92,9),// RSAOAEP"1.2.840.113549.1.1.8"=>data.Slice(101,9),// MGF1"1.2.840.113549.1.1.9"=>data.Slice(110,9),// OaepPSpecified"1.2.840.113549.1.1.10"=>data.Slice(119,9),// RSAPSS"1.2.840.113549.1.1.11"=>data.Slice(128,9),// RSAWithSha256"1.2.840.113549.1.1.12"=>data.Slice(137,9),// RSAWithSha384"1.2.840.113549.1.1.13"=>data.Slice(146,9),// RSAWithSha512"1.2.840.113549.1.5.3"=>data.Slice(155,9),// PbeWithMD5AndDESCBC"1.2.840.113549.1.5.10"=>data.Slice(164,9),// PbeWithSha1AndDESCBC"1.2.840.113549.1.5.11"=>data.Slice(173,9),// PbeWithSha1AndRC2CBC"1.2.840.113549.1.5.12"=>data.Slice(182,9),// Pbkdf2"1.2.840.113549.1.5.13"=>data.Slice(191,9),// PasswordBasedEncryptionScheme2"1.2.840.113549.1.7.1"=>data.Slice(200,9),// Pkcs7Data"1.2.840.113549.1.7.2"=>data.Slice(209,9),// Pkcs7SignedData"1.2.840.113549.1.7.3"=>data.Slice(218,9),// Pkcs7EnvelopedData"1.2.840.113549.1.7.6"=>data.Slice(227,9),// Pkcs7EncryptedData"1.2.840.113549.1.9.1"=>data.Slice(236,9),// Pkcs9EmailAddress"1.2.840.113549.1.9.3"=>data.Slice(245,9),// Pkcs9ContentType"1.2.840.113549.1.9.4"=>data.Slice(254,9),// Pkcs9MessageDigest"1.2.840.113549.1.9.5"=>data.Slice(263,9),// Pkcs9SigningTime"1.2.840.113549.1.9.6"=>data.Slice(272,9),// Pkcs9CounterSigner"1.2.840.113549.1.9.7"=>data.Slice(281,9),// Pkcs9Challenge"1.2.840.113549.1.9.14"=>data.Slice(290,9),// Pkcs9ExtensionRequest"1.2.840.113549.1.9.15"=>data.Slice(299,9),// Pkcs9SMimeCapabilities"1.2.840.113549.1.9.16.1.4"=>data.Slice(308,11),// TstInfo"1.2.840.113549.1.9.16.2.12"=>data.Slice(319,11),// SigningCertificateAttr"1.2.840.113549.1.9.16.2.14"=>data.Slice(330,11),// SignatureTimeStampAttr"1.2.840.113549.1.9.16.2.47"=>data.Slice(341,11),// SigningCertificateV2Attr"1.2.840.113549.1.9.20"=>data.Slice(352,9),// Pkcs9FriendlyName"1.2.840.113549.1.9.21"=>data.Slice(361,9),// LocalKeyId"1.2.840.113549.1.9.22.1"=>data.Slice(370,10),// Pkcs12X509CertType"1.2.840.113549.1.12.1.3"=>data.Slice(380,10),// Pkcs12TripleDes"1.2.840.113549.1.12.1.5"=>data.Slice(390,10),// Pkcs12Rc2Cbc128"1.2.840.113549.1.12.1.6"=>data.Slice(400,10),// Pkcs12Rc2Cbc40"1.2.840.113549.1.12.10.1.1"=>data.Slice(410,11),// Pkcs12KeyBag"1.2.840.113549.1.12.10.1.2"=>data.Slice(421,11),// Pkcs12ShroudedKeyBag"1.2.840.113549.1.12.10.1.3"=>data.Slice(432,11),// Pkcs12CertBag"1.2.840.113549.1.12.10.1.5"=>data.Slice(443,11),// Pkcs12SecretBag"1.2.840.113549.1.12.10.1.6"=>data.Slice(454,11),// Pkcs12SafeContentsBag"1.2.840.113549.2.5"=>data.Slice(465,8),// MD5"1.2.840.113549.2.7"=>data.Slice(473,8),// HMACSHA1"1.2.840.113549.2.9"=>data.Slice(481,8),// HMACSHA256"1.2.840.113549.2.10"=>data.Slice(489,8),// HMACSHA384"1.2.840.113549.2.11"=>data.Slice(497,8),// HMACSHA512"1.2.840.113549.3.2"=>data.Slice(505,8),// RC2CBC"1.2.840.113549.3.7"=>data.Slice(513,8),// TripleDESCBC"1.3.6.1.4.1.311.17.1"=>data.Slice(521,9),// Pkcs12KeyProviderName"1.3.6.1.4.1.311.17.3.20"=>data.Slice(530,10),// KeyIdentifier"1.3.6.1.4.1.311.20.2.3"=>data.Slice(540,10),// UserPrincipalName"1.3.6.1.4.1.311.88.2.1"=>data.Slice(550,10),// DocumentNameAttr"1.3.6.1.4.1.311.88.2.2"=>data.Slice(560,10),// DocumentDescriptionAttr"1.3.6.1.5.5.7.3.1"=>data.Slice(570,8),// KeyPurposeTlsServer"1.3.6.1.5.5.7.3.2"=>data.Slice(578,8),// KeyPurposeTlsClient"1.3.6.1.5.5.7.3.3"=>data.Slice(586,8),// KeyPurposeCodeSign"1.3.6.1.5.5.7.3.4"=>data.Slice(594,8),// KeyPurposeEmailProtection"1.3.6.1.5.5.7.3.8"=>data.Slice(602,8),// KeyPurposeTimestamping"1.3.6.1.5.5.7.3.9"=>data.Slice(610,8),// KeyPurposeOcspSigner"1.3.6.1.5.5.7.6.2"=>data.Slice(618,8),// Pkcs7NoSignature"1.3.6.1.5.5.7.48.1"=>data.Slice(626,8),// OCSP"1.3.6.1.5.5.7.48.1.2"=>data.Slice(634,9),// OcspNonce"1.3.6.1.5.5.7.48.2"=>data.Slice(643,8),// CAIssuers"1.3.14.3.2.26"=>data.Slice(651,5),// SHA1"1.3.14.3.2.7"=>data.Slice(656,5),// DES"1.3.132.0.34"=>data.Slice(661,5),// Secp384r1"1.3.132.0.35"=>data.Slice(666,5),// Secp521r1"2.5.4.3"=>data.Slice(671,3),// CommonName"2.5.4.5"=>data.Slice(674,3),// SerialNumber"2.5.4.6"=>data.Slice(677,3),// CountryOrRegionName"2.5.4.7"=>data.Slice(680,3),// Locality"2.5.4.8"=>data.Slice(683,3),// StateOrProvinceName"2.5.4.10"=>data.Slice(686,3),// OrganizationName"2.5.4.11"=>data.Slice(689,3),// OrganizationalUnit"2.5.4.97"=>data.Slice(692,3),// OrganizationIdentifier"2.5.29.14"=>data.Slice(695,3),// SubjectKeyIdentifier"2.5.29.15"=>data.Slice(698,3),// KeyUsage"2.5.29.17"=>data.Slice(701,3),// SubjectAlternativeName"2.5.29.19"=>data.Slice(704,3),// BasicConstraints"2.5.29.20"=>data.Slice(707,3),// CrlNumber"2.5.29.35"=>data.Slice(710,3),// AuthorityKeyIdentifier"2.16.840.1.101.3.4.1.2"=>data.Slice(713,9),// Aes128Cbc"2.16.840.1.101.3.4.1.22"=>data.Slice(722,9),// Aes192Cbc"2.16.840.1.101.3.4.1.42"=>data.Slice(731,9),// Aes256Cbc"2.16.840.1.101.3.4.2.1"=>data.Slice(740,9),// Sha256"2.16.840.1.101.3.4.2.2"=>data.Slice(749,9),// Sha384"2.16.840.1.101.3.4.2.3"=>data.Slice(758,9),// Sha512"2.23.140.1.2.1"=>data.Slice(767,6),// CabForumDV"2.23.140.1.2.2"=>data.Slice(773,6),// CabForumOV
_ =>ReadOnlySpan<byte>.Empty};}}}

Thank you for your contribution to size reduction @am11 !

@adamsitnikadamsitnik self-assigned this May 17, 2023
@adamsitnik
adamsitnik merged commit 976409d into dotnet:mainMay 17, 2023
@ghostghost locked as resolved and limited conversation to collaborators Jun 16, 2023
@am11
am11 deleted the patch-19 branch June 14, 2024 04:53
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Formats.Asn1size-reductionIssues impacting final app size primary for size sensitive workloads

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@am11@stephentoub@EgorBo@jeffhandley@adamsitnik@bartonjs@teo-tsirpanis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Restructure WellKnownOids.cs - #84921

Merged
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19
May 17, 2023
Merged

Restructure WellKnownOids.cs#84921
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19

Conversation

@am11

@am11am11 commented Apr 17, 2023

Copy link
Copy Markdown
Member

By moving private static ROS to local ROS variable and changing switch expression to switch-case syntax, we save 7.3 KB in NativeAOT app.

It removes System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 largest shared framework methods list:

$ ./build.sh clr+libs+packs -c Release -p:IlcGenerateMapFile=true
$ xmlstarlet sel -t -m "//ObjectNodes/MethodCode" -v 'concat(@Length, ": ", @Name)' -n artifacts/obj/coreclr/crossgen2/arm64/Release/native/crossgen2.map.xml |\
sort -nr | head -10 | grep -E ': (System|S_P)_'| xml unescape

@am11am11 added size-reduction Issues impacting final app size primary for size sensitive workloads area-System.Formats.Asn1 and removed area-System.Formats.Asn1 labels Apr 17, 2023
"2.23.140.1.2.1" => CabForumDV,
"2.23.140.1.2.2" => CabForumOV,
_ => ReadOnlySpan<byte>.Empty,
case "1.2.840.10040.4.1": return DSA;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about you inline the new byte[]s?

@stephentoub

stephentoub commented Apr 17, 2023

Copy link
Copy Markdown
Member

It's fine to switch to using local or inline spans, but I'm not a big fan of changing the switch syntax in the name of saving a few bytes based on how it's currently lowered by the C# compiler. What's the impact of just the syntax change? I'd expect it to just be the difference between N stores into a local and one return vs N returns.

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

Reverted the switch-case change.

@stephentoub

Copy link
Copy Markdown
Member

Can you instead structure it like:

returnvalueswitch{"1.2.840.10040.4.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,},// DSA"1.2.840.10040.4.3"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,},// DSAWithSha1"1.2.840.10045.2.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,},// EC"1.2.840.10045.1.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,},// EcPrimeField"1.2.840.10045.1.2"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,},// EcChar2Field"1.2.840.10045.3.1.7"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,},// Secp256r1
...

?

@EgorBo

Copy link
Copy Markdown
Member

Part of the problem (I've checked the current impl in this PR) is:

Inlines into System.Formats.Asn1.WellKnownOids:GetContents(System.ReadOnlySpan`1[ushort]):System.ReadOnlySpan`1[ubyte]:
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:get_Empty():System.ReadOnlySpan`1[ubyte]

JIT blows up from the number of temp locals, perhaps you can split it into two functions?

@stephentoub

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

@EgorBo

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

Looks like it makes it even worse (more locals), presumably, because Roslyn spills it anyway.
We either need to bump the limit of locals JIT can track or/and I also need to limit "string.Equals" unrolling optimization when we have too many locals already

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

UPD: looks like it's not Span/String.Equals's fault

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

I'm trying another approach by having one local and slicing.

I opened this PR by making change in browser, while my local HEAD was a few days old. Though it still saves 7+ K compared to main, it's no longer dropping System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 list, see the PR description. Looks like some recent change in JIT..

@EgorBo

Copy link
Copy Markdown
Member

Ok, I've bumped the "number of locals JIT can track" limit and it removed all not-inlined methods (all of them are now inlined) and reduced total size of the method in half

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

Looks like some recent change in JIT..

@am11 I think it's either #84530 or #83945

@jeffhandley

Copy link
Copy Markdown
Member

Tagging @dotnet/area-system-formats-asn1 since msftbot was down when the label was applied

Comment on lines +299 to +300
"1.3.132.0.35" => data.Slice(666, 5), // Secp521r1
"2.5.4.3" => data.Slice(671, 3), // CommonName

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a little bothered by how this will make future insertions hard to maintain in the same style. Right now, everything is sorted by the dotted decimal string (or the binary encoding, since they sort the same way). So, if in the future 2.5.4.2 is determined to be common enough to be worth encoding in the table, someone will have to decide between a) putting the new value at the end of the unified blob (being the first unsorted entry) or b) adding 3 to lines 300-321.

That said, adding things to this should be rare; so the savings might pay for the future frustration.

@adamsitnikadamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That said, adding things to this should be rare; so the savings might pay for the future frustration.

I agree with @bartonjs

I wrote a simple console app to verify that the change is not introducing any bug:

Details
namespaceWellKnownTests{internalclassProgram{staticvoidMain(string[]args){Test("1.2.840.10040.4.1");Test("1.2.840.10040.4.3");Test("1.2.840.10045.2.1");Test("1.2.840.10045.1.1");Test("1.2.840.10045.1.2");Test("1.2.840.10045.3.1.7");Test("1.2.840.10045.4.1");Test("1.2.840.10045.4.3.2");Test("1.2.840.10045.4.3.3");Test("1.2.840.10045.4.3.4");Test("1.2.840.113549.1.1.1");Test("1.2.840.113549.1.1.5");Test("1.2.840.113549.1.1.7");Test("1.2.840.113549.1.1.8");Test("1.2.840.113549.1.1.9");Test("1.2.840.113549.1.1.10");Test("1.2.840.113549.1.1.11");Test("1.2.840.113549.1.1.12");Test("1.2.840.113549.1.1.13");Test("1.2.840.113549.1.5.3");Test("1.2.840.113549.1.5.10");Test("1.2.840.113549.1.5.11");Test("1.2.840.113549.1.5.12");Test("1.2.840.113549.1.5.13");Test("1.2.840.113549.1.7.1");Test("1.2.840.113549.1.7.2");Test("1.2.840.113549.1.7.3");Test("1.2.840.113549.1.7.6");Test("1.2.840.113549.1.9.1");Test("1.2.840.113549.1.9.3");Test("1.2.840.113549.1.9.4");Test("1.2.840.113549.1.9.5");Test("1.2.840.113549.1.9.6");Test("1.2.840.113549.1.9.7");Test("1.2.840.113549.1.9.14");Test("1.2.840.113549.1.9.15");Test("1.2.840.113549.1.9.16.1.4");Test("1.2.840.113549.1.9.16.2.12");Test("1.2.840.113549.1.9.16.2.14");Test("1.2.840.113549.1.9.16.2.47");Test("1.2.840.113549.1.9.20");Test("1.2.840.113549.1.9.21");Test("1.2.840.113549.1.9.22.1");Test("1.2.840.113549.1.12.1.3");Test("1.2.840.113549.1.12.1.5");Test("1.2.840.113549.1.12.1.6");Test("1.2.840.113549.1.12.10.1.1");Test("1.2.840.113549.1.12.10.1.2");Test("1.2.840.113549.1.12.10.1.3");Test("1.2.840.113549.1.12.10.1.5");Test("1.2.840.113549.1.12.10.1.6");Test("1.2.840.113549.2.5");Test("1.2.840.113549.2.7");Test("1.2.840.113549.2.9");Test("1.2.840.113549.2.10");Test("1.2.840.113549.2.11");Test("1.2.840.113549.3.2");Test("1.2.840.113549.3.7");Test("1.3.6.1.4.1.311.17.1");Test("1.3.6.1.4.1.311.17.3.20");Test("1.3.6.1.4.1.311.20.2.3");Test("1.3.6.1.4.1.311.88.2.1");Test("1.3.6.1.4.1.311.88.2.2");Test("1.3.6.1.5.5.7.3.1");Test("1.3.6.1.5.5.7.3.2");Test("1.3.6.1.5.5.7.3.3");Test("1.3.6.1.5.5.7.3.4");Test("1.3.6.1.5.5.7.3.8");Test("1.3.6.1.5.5.7.3.9");Test("1.3.6.1.5.5.7.6.2");Test("1.3.6.1.5.5.7.48.1");Test("1.3.6.1.5.5.7.48.1.2");Test("1.3.6.1.5.5.7.48.2");Test("1.3.14.3.2.26");Test("1.3.14.3.2.7");Test("1.3.132.0.34");Test("1.3.132.0.35");Test("2.5.4.3");Test("2.5.4.5");Test("2.5.4.6");Test("2.5.4.7");Test("2.5.4.8");Test("2.5.4.10");Test("2.5.4.11");Test("2.5.4.97");Test("2.5.29.14");Test("2.5.29.15");Test("2.5.29.17");Test("2.5.29.19");Test("2.5.29.20");Test("2.5.29.35");Test("2.16.840.1.101.3.4.1.2");Test("2.16.840.1.101.3.4.1.22");Test("2.16.840.1.101.3.4.1.42");Test("2.16.840.1.101.3.4.2.1");Test("2.16.840.1.101.3.4.2.2");Test("2.16.840.1.101.3.4.2.3");Test("2.23.140.1.2.1");Test("2.23.140.1.2.2");staticvoidTest(stringvalue){ReadOnlySpan<byte>mainContents=WellKnownOids_Main.GetContents(value);ReadOnlySpan<byte>prContents=WellKnownOids_PR.GetContents(value);if(!mainContents.SequenceEqual(prContents)){thrownewException($"GetContents Bug for {value}");}string?mainValue=WellKnownOids_Main.GetValue(mainContents);string?prValue=WellKnownOids_PR.GetValue(prContents);if(prValue!=mainValue){thrownewException($"GetValue Bug for {value}");}}}}internalstaticclassWellKnownOids_Main{privatestaticReadOnlySpan<byte>DSA=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,};privatestaticReadOnlySpan<byte>DSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,};privatestaticReadOnlySpan<byte>EC=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,};privatestaticReadOnlySpan<byte>EcPrimeField=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,};privatestaticReadOnlySpan<byte>EcChar2Field=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,};privatestaticReadOnlySpan<byte>Secp256r1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,};privatestaticReadOnlySpan<byte>ECDSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,};privatestaticReadOnlySpan<byte>ECDSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,};privatestaticReadOnlySpan<byte>ECDSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,};privatestaticReadOnlySpan<byte>ECDSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,};privatestaticReadOnlySpan<byte>RSA=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,};privatestaticReadOnlySpan<byte>RSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,};privatestaticReadOnlySpan<byte>RSAOAEP=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,};privatestaticReadOnlySpan<byte>MGF1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,};privatestaticReadOnlySpan<byte>OaepPSpecified=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,};privatestaticReadOnlySpan<byte>RSAPSS=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,};privatestaticReadOnlySpan<byte>RSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,};privatestaticReadOnlySpan<byte>RSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,};privatestaticReadOnlySpan<byte>RSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,};privatestaticReadOnlySpan<byte>PbeWithMD5AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,};privatestaticReadOnlySpan<byte>PbeWithSha1AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,};privatestaticReadOnlySpan<byte>PbeWithSha1AndRC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,};privatestaticReadOnlySpan<byte>Pbkdf2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,};privatestaticReadOnlySpan<byte>PasswordBasedEncryptionScheme2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,};privatestaticReadOnlySpan<byte>Pkcs7Data=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,};privatestaticReadOnlySpan<byte>Pkcs7SignedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,};privatestaticReadOnlySpan<byte>Pkcs7EnvelopedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,};privatestaticReadOnlySpan<byte>Pkcs7EncryptedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,};privatestaticReadOnlySpan<byte>Pkcs9EmailAddress=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,};privatestaticReadOnlySpan<byte>Pkcs9ContentType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,};privatestaticReadOnlySpan<byte>Pkcs9MessageDigest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,};privatestaticReadOnlySpan<byte>Pkcs9SigningTime=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,};privatestaticReadOnlySpan<byte>Pkcs9CounterSigner=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,};privatestaticReadOnlySpan<byte>Pkcs9Challenge=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,};privatestaticReadOnlySpan<byte>Pkcs9ExtensionRequest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,};privatestaticReadOnlySpan<byte>Pkcs9SMimeCapabilities=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,};privatestaticReadOnlySpan<byte>TstInfo=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,};privatestaticReadOnlySpan<byte>SigningCertificateAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,};privatestaticReadOnlySpan<byte>SignatureTimeStampAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,};privatestaticReadOnlySpan<byte>SigningCertificateV2Attr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,};privatestaticReadOnlySpan<byte>Pkcs9FriendlyName=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,};privatestaticReadOnlySpan<byte>LocalKeyId=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,};privatestaticReadOnlySpan<byte>Pkcs12X509CertType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,};privatestaticReadOnlySpan<byte>Pkcs12TripleDes=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc128=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc40=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,};privatestaticReadOnlySpan<byte>Pkcs12KeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,};privatestaticReadOnlySpan<byte>Pkcs12ShroudedKeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,};privatestaticReadOnlySpan<byte>Pkcs12CertBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12SecretBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12SafeContentsBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,};privatestaticReadOnlySpan<byte>MD5=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,};privatestaticReadOnlySpan<byte>HMACSHA1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,};privatestaticReadOnlySpan<byte>HMACSHA256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,};privatestaticReadOnlySpan<byte>HMACSHA384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,};privatestaticReadOnlySpan<byte>HMACSHA512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,};privatestaticReadOnlySpan<byte>RC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,};privatestaticReadOnlySpan<byte>TripleDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,};privatestaticReadOnlySpan<byte>Pkcs12KeyProviderName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,};privatestaticReadOnlySpan<byte>KeyIdentifier=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,};privatestaticReadOnlySpan<byte>UserPrincipalName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,};privatestaticReadOnlySpan<byte>DocumentNameAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,};privatestaticReadOnlySpan<byte>DocumentDescriptionAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeTlsServer=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,};privatestaticReadOnlySpan<byte>KeyPurposeTlsClient=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeCodeSign=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,};privatestaticReadOnlySpan<byte>KeyPurposeEmailProtection=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,};privatestaticReadOnlySpan<byte>KeyPurposeTimestamping=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,};privatestaticReadOnlySpan<byte>KeyPurposeOcspSigner=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,};privatestaticReadOnlySpan<byte>Pkcs7NoSignature=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,};privatestaticReadOnlySpan<byte>OCSP=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,};privatestaticReadOnlySpan<byte>OcspNonce=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,};privatestaticReadOnlySpan<byte>CAIssuers=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,};privatestaticReadOnlySpan<byte>SHA1=>newbyte[]{0x2B,0x0E,0x03,0x02,0x1A,};privatestaticReadOnlySpan<byte>DES=>newbyte[]{0x2B,0x0E,0x03,0x02,0x07,};privatestaticReadOnlySpan<byte>Secp384r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x22,};privatestaticReadOnlySpan<byte>Secp521r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x23,};privatestaticReadOnlySpan<byte>CommonName=>newbyte[]{0x55,0x04,0x03,};privatestaticReadOnlySpan<byte>SerialNumber=>newbyte[]{0x55,0x04,0x05,};privatestaticReadOnlySpan<byte>CountryOrRegionName=>newbyte[]{0x55,0x04,0x06,};privatestaticReadOnlySpan<byte>Locality=>newbyte[]{0x55,0x04,0x07,};privatestaticReadOnlySpan<byte>StateOrProvinceName=>newbyte[]{0x55,0x04,0x08,};privatestaticReadOnlySpan<byte>OrganizationName=>newbyte[]{0x55,0x04,0x0A,};privatestaticReadOnlySpan<byte>OrganizationalUnit=>newbyte[]{0x55,0x04,0x0B,};privatestaticReadOnlySpan<byte>OrganizationIdentifier=>newbyte[]{0x55,0x04,0x61,};privatestaticReadOnlySpan<byte>SubjectKeyIdentifier=>newbyte[]{0x55,0x1D,0x0E,};privatestaticReadOnlySpan<byte>KeyUsage=>newbyte[]{0x55,0x1D,0x0F,};privatestaticReadOnlySpan<byte>SubjectAlternativeName=>newbyte[]{0x55,0x1D,0x11,};privatestaticReadOnlySpan<byte>BasicConstraints=>newbyte[]{0x55,0x1D,0x13,};privatestaticReadOnlySpan<byte>CrlNumber=>newbyte[]{0x55,0x1D,0x14,};privatestaticReadOnlySpan<byte>AuthorityKeyIdentifier=>newbyte[]{0x55,0x1D,0x23,};privatestaticReadOnlySpan<byte>Aes128Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,};privatestaticReadOnlySpan<byte>Aes192Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,};privatestaticReadOnlySpan<byte>Aes256Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,};privatestaticReadOnlySpan<byte>Sha256=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,};privatestaticReadOnlySpan<byte>Sha384=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,};privatestaticReadOnlySpan<byte>Sha512=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,};privatestaticReadOnlySpan<byte>CabForumDV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x01,};privatestaticReadOnlySpan<byte>CabForumOV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x02,};internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){returnvalueswitch{"1.2.840.10040.4.1"=>DSA,"1.2.840.10040.4.3"=>DSAWithSha1,"1.2.840.10045.2.1"=>EC,"1.2.840.10045.1.1"=>EcPrimeField,"1.2.840.10045.1.2"=>EcChar2Field,"1.2.840.10045.3.1.7"=>Secp256r1,"1.2.840.10045.4.1"=>ECDSAWithSha1,"1.2.840.10045.4.3.2"=>ECDSAWithSha256,"1.2.840.10045.4.3.3"=>ECDSAWithSha384,"1.2.840.10045.4.3.4"=>ECDSAWithSha512,"1.2.840.113549.1.1.1"=>RSA,"1.2.840.113549.1.1.5"=>RSAWithSha1,"1.2.840.113549.1.1.7"=>RSAOAEP,"1.2.840.113549.1.1.8"=>MGF1,"1.2.840.113549.1.1.9"=>OaepPSpecified,"1.2.840.113549.1.1.10"=>RSAPSS,"1.2.840.113549.1.1.11"=>RSAWithSha256,"1.2.840.113549.1.1.12"=>RSAWithSha384,"1.2.840.113549.1.1.13"=>RSAWithSha512,"1.2.840.113549.1.5.3"=>PbeWithMD5AndDESCBC,"1.2.840.113549.1.5.10"=>PbeWithSha1AndDESCBC,"1.2.840.113549.1.5.11"=>PbeWithSha1AndRC2CBC,"1.2.840.113549.1.5.12"=>Pbkdf2,"1.2.840.113549.1.5.13"=>PasswordBasedEncryptionScheme2,"1.2.840.113549.1.7.1"=>Pkcs7Data,"1.2.840.113549.1.7.2"=>Pkcs7SignedData,"1.2.840.113549.1.7.3"=>Pkcs7EnvelopedData,"1.2.840.113549.1.7.6"=>Pkcs7EncryptedData,"1.2.840.113549.1.9.1"=>Pkcs9EmailAddress,"1.2.840.113549.1.9.3"=>Pkcs9ContentType,"1.2.840.113549.1.9.4"=>Pkcs9MessageDigest,"1.2.840.113549.1.9.5"=>Pkcs9SigningTime,"1.2.840.113549.1.9.6"=>Pkcs9CounterSigner,"1.2.840.113549.1.9.7"=>Pkcs9Challenge,"1.2.840.113549.1.9.14"=>Pkcs9ExtensionRequest,"1.2.840.113549.1.9.15"=>Pkcs9SMimeCapabilities,"1.2.840.113549.1.9.16.1.4"=>TstInfo,"1.2.840.113549.1.9.16.2.12"=>SigningCertificateAttr,"1.2.840.113549.1.9.16.2.14"=>SignatureTimeStampAttr,"1.2.840.113549.1.9.16.2.47"=>SigningCertificateV2Attr,"1.2.840.113549.1.9.20"=>Pkcs9FriendlyName,"1.2.840.113549.1.9.21"=>LocalKeyId,"1.2.840.113549.1.9.22.1"=>Pkcs12X509CertType,"1.2.840.113549.1.12.1.3"=>Pkcs12TripleDes,"1.2.840.113549.1.12.1.5"=>Pkcs12Rc2Cbc128,"1.2.840.113549.1.12.1.6"=>Pkcs12Rc2Cbc40,"1.2.840.113549.1.12.10.1.1"=>Pkcs12KeyBag,"1.2.840.113549.1.12.10.1.2"=>Pkcs12ShroudedKeyBag,"1.2.840.113549.1.12.10.1.3"=>Pkcs12CertBag,"1.2.840.113549.1.12.10.1.5"=>Pkcs12SecretBag,"1.2.840.113549.1.12.10.1.6"=>Pkcs12SafeContentsBag,"1.2.840.113549.2.5"=>MD5,"1.2.840.113549.2.7"=>HMACSHA1,"1.2.840.113549.2.9"=>HMACSHA256,"1.2.840.113549.2.10"=>HMACSHA384,"1.2.840.113549.2.11"=>HMACSHA512,"1.2.840.113549.3.2"=>RC2CBC,"1.2.840.113549.3.7"=>TripleDESCBC,"1.3.6.1.4.1.311.17.1"=>Pkcs12KeyProviderName,"1.3.6.1.4.1.311.17.3.20"=>KeyIdentifier,"1.3.6.1.4.1.311.20.2.3"=>UserPrincipalName,"1.3.6.1.4.1.311.88.2.1"=>DocumentNameAttr,"1.3.6.1.4.1.311.88.2.2"=>DocumentDescriptionAttr,"1.3.6.1.5.5.7.3.1"=>KeyPurposeTlsServer,"1.3.6.1.5.5.7.3.2"=>KeyPurposeTlsClient,"1.3.6.1.5.5.7.3.3"=>KeyPurposeCodeSign,"1.3.6.1.5.5.7.3.4"=>KeyPurposeEmailProtection,"1.3.6.1.5.5.7.3.8"=>KeyPurposeTimestamping,"1.3.6.1.5.5.7.3.9"=>KeyPurposeOcspSigner,"1.3.6.1.5.5.7.6.2"=>Pkcs7NoSignature,"1.3.6.1.5.5.7.48.1"=>OCSP,"1.3.6.1.5.5.7.48.1.2"=>OcspNonce,"1.3.6.1.5.5.7.48.2"=>CAIssuers,"1.3.14.3.2.26"=>SHA1,"1.3.14.3.2.7"=>DES,"1.3.132.0.34"=>Secp384r1,"1.3.132.0.35"=>Secp521r1,"2.5.4.3"=>CommonName,"2.5.4.5"=>SerialNumber,"2.5.4.6"=>CountryOrRegionName,"2.5.4.7"=>Locality,"2.5.4.8"=>StateOrProvinceName,"2.5.4.10"=>OrganizationName,"2.5.4.11"=>OrganizationalUnit,"2.5.4.97"=>OrganizationIdentifier,"2.5.29.14"=>SubjectKeyIdentifier,"2.5.29.15"=>KeyUsage,"2.5.29.17"=>SubjectAlternativeName,"2.5.29.19"=>BasicConstraints,"2.5.29.20"=>CrlNumber,"2.5.29.35"=>AuthorityKeyIdentifier,"2.16.840.1.101.3.4.1.2"=>Aes128Cbc,"2.16.840.1.101.3.4.1.22"=>Aes192Cbc,"2.16.840.1.101.3.4.1.42"=>Aes256Cbc,"2.16.840.1.101.3.4.2.1"=>Sha256,"2.16.840.1.101.3.4.2.2"=>Sha384,"2.16.840.1.101.3.4.2.3"=>Sha512,"2.23.140.1.2.1"=>CabForumDV,"2.23.140.1.2.2"=>CabForumOV,
_ =>ReadOnlySpan<byte>.Empty,};}}internalstaticclassWellKnownOids_PR{internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){ReadOnlySpan<byte>data=newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,// DSA0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,// DSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,// EC0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,// EcPrimeField0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,// EcChar2Field0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,// Secp256r10x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,// ECDSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,// ECDSAWithSha2560x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,// ECDSAWithSha3840x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,// ECDSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,// RSA0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,// RSAWithSha10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,// RSAOAEP0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,// MGF10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,// OaepPSpecified0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,// RSAPSS0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,// RSAWithSha2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,// RSAWithSha3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,// RSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,// PbeWithMD5AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,// PbeWithSha1AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,// PbeWithSha1AndRC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,// Pbkdf20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,// PasswordBasedEncryptionScheme20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,// Pkcs7Data0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,// Pkcs7SignedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,// Pkcs7EnvelopedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,// Pkcs7EncryptedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,// Pkcs9EmailAddress0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,// Pkcs9ContentType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,// Pkcs9MessageDigest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,// Pkcs9SigningTime0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,// Pkcs9CounterSigner0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,// Pkcs9Challenge0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,// Pkcs9ExtensionRequest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,// Pkcs9SMimeCapabilities0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,// TstInfo0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,// SigningCertificateAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,// SignatureTimeStampAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,// SigningCertificateV2Attr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,// Pkcs9FriendlyName0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,// LocalKeyId0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,// Pkcs12X509CertType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,// Pkcs12TripleDes0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,// Pkcs12Rc2Cbc1280x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,// Pkcs12Rc2Cbc400x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,// Pkcs12KeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,// Pkcs12ShroudedKeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,// Pkcs12CertBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,// Pkcs12SecretBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,// Pkcs12SafeContentsBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,// MD50x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,// HMACSHA10x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,// HMACSHA2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,// HMACSHA3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,// HMACSHA5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,// RC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,// TripleDESCBC0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,// Pkcs12KeyProviderName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,// KeyIdentifier0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,// UserPrincipalName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,// DocumentNameAttr0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,// DocumentDescriptionAttr0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,// KeyPurposeTlsServer0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,// KeyPurposeTlsClient0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,// KeyPurposeCodeSign0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,// KeyPurposeEmailProtection0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,// KeyPurposeTimestamping0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,// KeyPurposeOcspSigner0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,// Pkcs7NoSignature0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,// OCSP0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,// OcspNonce0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,// CAIssuers0x2B,0x0E,0x03,0x02,0x1A,// SHA10x2B,0x0E,0x03,0x02,0x07,// DES0x2B,0x81,0x04,0x00,0x22,// Secp384r10x2B,0x81,0x04,0x00,0x23,// Secp521r10x55,0x04,0x03,// CommonName0x55,0x04,0x05,// SerialNumber0x55,0x04,0x06,// CountryOrRegionName0x55,0x04,0x07,// Locality0x55,0x04,0x08,// StateOrProvinceName0x55,0x04,0x0A,// OrganizationName0x55,0x04,0x0B,// OrganizationalUnit0x55,0x04,0x61,// OrganizationIdentifier0x55,0x1D,0x0E,// SubjectKeyIdentifier0x55,0x1D,0x0F,// KeyUsage0x55,0x1D,0x11,// SubjectAlternativeName0x55,0x1D,0x13,// BasicConstraints0x55,0x1D,0x14,// CrlNumber0x55,0x1D,0x23,// AuthorityKeyIdentifier0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,// Aes128Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,// Aes192Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,// Aes256Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,// Sha2560x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,// Sha3840x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,// Sha5120x67,0x81,0x0C,0x01,0x02,0x01,// CabForumDV0x67,0x81,0x0C,0x01,0x02,0x02,// CabForumOV};returnvalueswitch{"1.2.840.10040.4.1"=>data.Slice(0,7),// DSA"1.2.840.10040.4.3"=>data.Slice(7,7),// DSAWithSha1"1.2.840.10045.2.1"=>data.Slice(14,7),// EC"1.2.840.10045.1.1"=>data.Slice(21,7),// EcPrimeField"1.2.840.10045.1.2"=>data.Slice(28,7),// EcChar2Field"1.2.840.10045.3.1.7"=>data.Slice(35,8),// Secp256r1"1.2.840.10045.4.1"=>data.Slice(43,7),// ECDSAWithSha1"1.2.840.10045.4.3.2"=>data.Slice(50,8),// ECDSAWithSha256"1.2.840.10045.4.3.3"=>data.Slice(58,8),// ECDSAWithSha384"1.2.840.10045.4.3.4"=>data.Slice(66,8),// ECDSAWithSha512"1.2.840.113549.1.1.1"=>data.Slice(74,9),// RSA"1.2.840.113549.1.1.5"=>data.Slice(83,9),// RSAWithSha1"1.2.840.113549.1.1.7"=>data.Slice(92,9),// RSAOAEP"1.2.840.113549.1.1.8"=>data.Slice(101,9),// MGF1"1.2.840.113549.1.1.9"=>data.Slice(110,9),// OaepPSpecified"1.2.840.113549.1.1.10"=>data.Slice(119,9),// RSAPSS"1.2.840.113549.1.1.11"=>data.Slice(128,9),// RSAWithSha256"1.2.840.113549.1.1.12"=>data.Slice(137,9),// RSAWithSha384"1.2.840.113549.1.1.13"=>data.Slice(146,9),// RSAWithSha512"1.2.840.113549.1.5.3"=>data.Slice(155,9),// PbeWithMD5AndDESCBC"1.2.840.113549.1.5.10"=>data.Slice(164,9),// PbeWithSha1AndDESCBC"1.2.840.113549.1.5.11"=>data.Slice(173,9),// PbeWithSha1AndRC2CBC"1.2.840.113549.1.5.12"=>data.Slice(182,9),// Pbkdf2"1.2.840.113549.1.5.13"=>data.Slice(191,9),// PasswordBasedEncryptionScheme2"1.2.840.113549.1.7.1"=>data.Slice(200,9),// Pkcs7Data"1.2.840.113549.1.7.2"=>data.Slice(209,9),// Pkcs7SignedData"1.2.840.113549.1.7.3"=>data.Slice(218,9),// Pkcs7EnvelopedData"1.2.840.113549.1.7.6"=>data.Slice(227,9),// Pkcs7EncryptedData"1.2.840.113549.1.9.1"=>data.Slice(236,9),// Pkcs9EmailAddress"1.2.840.113549.1.9.3"=>data.Slice(245,9),// Pkcs9ContentType"1.2.840.113549.1.9.4"=>data.Slice(254,9),// Pkcs9MessageDigest"1.2.840.113549.1.9.5"=>data.Slice(263,9),// Pkcs9SigningTime"1.2.840.113549.1.9.6"=>data.Slice(272,9),// Pkcs9CounterSigner"1.2.840.113549.1.9.7"=>data.Slice(281,9),// Pkcs9Challenge"1.2.840.113549.1.9.14"=>data.Slice(290,9),// Pkcs9ExtensionRequest"1.2.840.113549.1.9.15"=>data.Slice(299,9),// Pkcs9SMimeCapabilities"1.2.840.113549.1.9.16.1.4"=>data.Slice(308,11),// TstInfo"1.2.840.113549.1.9.16.2.12"=>data.Slice(319,11),// SigningCertificateAttr"1.2.840.113549.1.9.16.2.14"=>data.Slice(330,11),// SignatureTimeStampAttr"1.2.840.113549.1.9.16.2.47"=>data.Slice(341,11),// SigningCertificateV2Attr"1.2.840.113549.1.9.20"=>data.Slice(352,9),// Pkcs9FriendlyName"1.2.840.113549.1.9.21"=>data.Slice(361,9),// LocalKeyId"1.2.840.113549.1.9.22.1"=>data.Slice(370,10),// Pkcs12X509CertType"1.2.840.113549.1.12.1.3"=>data.Slice(380,10),// Pkcs12TripleDes"1.2.840.113549.1.12.1.5"=>data.Slice(390,10),// Pkcs12Rc2Cbc128"1.2.840.113549.1.12.1.6"=>data.Slice(400,10),// Pkcs12Rc2Cbc40"1.2.840.113549.1.12.10.1.1"=>data.Slice(410,11),// Pkcs12KeyBag"1.2.840.113549.1.12.10.1.2"=>data.Slice(421,11),// Pkcs12ShroudedKeyBag"1.2.840.113549.1.12.10.1.3"=>data.Slice(432,11),// Pkcs12CertBag"1.2.840.113549.1.12.10.1.5"=>data.Slice(443,11),// Pkcs12SecretBag"1.2.840.113549.1.12.10.1.6"=>data.Slice(454,11),// Pkcs12SafeContentsBag"1.2.840.113549.2.5"=>data.Slice(465,8),// MD5"1.2.840.113549.2.7"=>data.Slice(473,8),// HMACSHA1"1.2.840.113549.2.9"=>data.Slice(481,8),// HMACSHA256"1.2.840.113549.2.10"=>data.Slice(489,8),// HMACSHA384"1.2.840.113549.2.11"=>data.Slice(497,8),// HMACSHA512"1.2.840.113549.3.2"=>data.Slice(505,8),// RC2CBC"1.2.840.113549.3.7"=>data.Slice(513,8),// TripleDESCBC"1.3.6.1.4.1.311.17.1"=>data.Slice(521,9),// Pkcs12KeyProviderName"1.3.6.1.4.1.311.17.3.20"=>data.Slice(530,10),// KeyIdentifier"1.3.6.1.4.1.311.20.2.3"=>data.Slice(540,10),// UserPrincipalName"1.3.6.1.4.1.311.88.2.1"=>data.Slice(550,10),// DocumentNameAttr"1.3.6.1.4.1.311.88.2.2"=>data.Slice(560,10),// DocumentDescriptionAttr"1.3.6.1.5.5.7.3.1"=>data.Slice(570,8),// KeyPurposeTlsServer"1.3.6.1.5.5.7.3.2"=>data.Slice(578,8),// KeyPurposeTlsClient"1.3.6.1.5.5.7.3.3"=>data.Slice(586,8),// KeyPurposeCodeSign"1.3.6.1.5.5.7.3.4"=>data.Slice(594,8),// KeyPurposeEmailProtection"1.3.6.1.5.5.7.3.8"=>data.Slice(602,8),// KeyPurposeTimestamping"1.3.6.1.5.5.7.3.9"=>data.Slice(610,8),// KeyPurposeOcspSigner"1.3.6.1.5.5.7.6.2"=>data.Slice(618,8),// Pkcs7NoSignature"1.3.6.1.5.5.7.48.1"=>data.Slice(626,8),// OCSP"1.3.6.1.5.5.7.48.1.2"=>data.Slice(634,9),// OcspNonce"1.3.6.1.5.5.7.48.2"=>data.Slice(643,8),// CAIssuers"1.3.14.3.2.26"=>data.Slice(651,5),// SHA1"1.3.14.3.2.7"=>data.Slice(656,5),// DES"1.3.132.0.34"=>data.Slice(661,5),// Secp384r1"1.3.132.0.35"=>data.Slice(666,5),// Secp521r1"2.5.4.3"=>data.Slice(671,3),// CommonName"2.5.4.5"=>data.Slice(674,3),// SerialNumber"2.5.4.6"=>data.Slice(677,3),// CountryOrRegionName"2.5.4.7"=>data.Slice(680,3),// Locality"2.5.4.8"=>data.Slice(683,3),// StateOrProvinceName"2.5.4.10"=>data.Slice(686,3),// OrganizationName"2.5.4.11"=>data.Slice(689,3),// OrganizationalUnit"2.5.4.97"=>data.Slice(692,3),// OrganizationIdentifier"2.5.29.14"=>data.Slice(695,3),// SubjectKeyIdentifier"2.5.29.15"=>data.Slice(698,3),// KeyUsage"2.5.29.17"=>data.Slice(701,3),// SubjectAlternativeName"2.5.29.19"=>data.Slice(704,3),// BasicConstraints"2.5.29.20"=>data.Slice(707,3),// CrlNumber"2.5.29.35"=>data.Slice(710,3),// AuthorityKeyIdentifier"2.16.840.1.101.3.4.1.2"=>data.Slice(713,9),// Aes128Cbc"2.16.840.1.101.3.4.1.22"=>data.Slice(722,9),// Aes192Cbc"2.16.840.1.101.3.4.1.42"=>data.Slice(731,9),// Aes256Cbc"2.16.840.1.101.3.4.2.1"=>data.Slice(740,9),// Sha256"2.16.840.1.101.3.4.2.2"=>data.Slice(749,9),// Sha384"2.16.840.1.101.3.4.2.3"=>data.Slice(758,9),// Sha512"2.23.140.1.2.1"=>data.Slice(767,6),// CabForumDV"2.23.140.1.2.2"=>data.Slice(773,6),// CabForumOV
_ =>ReadOnlySpan<byte>.Empty};}}}

Thank you for your contribution to size reduction @am11 !

@adamsitnikadamsitnik self-assigned this May 17, 2023
@adamsitnik
adamsitnik merged commit 976409d into dotnet:mainMay 17, 2023
@ghostghost locked as resolved and limited conversation to collaborators Jun 16, 2023
@am11
am11 deleted the patch-19 branch June 14, 2024 04:53
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Formats.Asn1size-reductionIssues impacting final app size primary for size sensitive workloads

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@am11@stephentoub@EgorBo@jeffhandley@adamsitnik@bartonjs@teo-tsirpanis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Restructure WellKnownOids.cs - #84921

Merged
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19
May 17, 2023
Merged

Restructure WellKnownOids.cs#84921
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19

Conversation

@am11

@am11am11 commented Apr 17, 2023

Copy link
Copy Markdown
Member

By moving private static ROS to local ROS variable and changing switch expression to switch-case syntax, we save 7.3 KB in NativeAOT app.

It removes System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 largest shared framework methods list:

$ ./build.sh clr+libs+packs -c Release -p:IlcGenerateMapFile=true
$ xmlstarlet sel -t -m "//ObjectNodes/MethodCode" -v 'concat(@Length, ": ", @Name)' -n artifacts/obj/coreclr/crossgen2/arm64/Release/native/crossgen2.map.xml |\
sort -nr | head -10 | grep -E ': (System|S_P)_'| xml unescape

@am11am11 added size-reduction Issues impacting final app size primary for size sensitive workloads area-System.Formats.Asn1 and removed area-System.Formats.Asn1 labels Apr 17, 2023
"2.23.140.1.2.1" => CabForumDV,
"2.23.140.1.2.2" => CabForumOV,
_ => ReadOnlySpan<byte>.Empty,
case "1.2.840.10040.4.1": return DSA;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about you inline the new byte[]s?

@stephentoub

stephentoub commented Apr 17, 2023

Copy link
Copy Markdown
Member

It's fine to switch to using local or inline spans, but I'm not a big fan of changing the switch syntax in the name of saving a few bytes based on how it's currently lowered by the C# compiler. What's the impact of just the syntax change? I'd expect it to just be the difference between N stores into a local and one return vs N returns.

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

Reverted the switch-case change.

@stephentoub

Copy link
Copy Markdown
Member

Can you instead structure it like:

returnvalueswitch{"1.2.840.10040.4.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,},// DSA"1.2.840.10040.4.3"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,},// DSAWithSha1"1.2.840.10045.2.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,},// EC"1.2.840.10045.1.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,},// EcPrimeField"1.2.840.10045.1.2"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,},// EcChar2Field"1.2.840.10045.3.1.7"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,},// Secp256r1
...

?

@EgorBo

Copy link
Copy Markdown
Member

Part of the problem (I've checked the current impl in this PR) is:

Inlines into System.Formats.Asn1.WellKnownOids:GetContents(System.ReadOnlySpan`1[ushort]):System.ReadOnlySpan`1[ubyte]:
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:get_Empty():System.ReadOnlySpan`1[ubyte]

JIT blows up from the number of temp locals, perhaps you can split it into two functions?

@stephentoub

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

@EgorBo

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

Looks like it makes it even worse (more locals), presumably, because Roslyn spills it anyway.
We either need to bump the limit of locals JIT can track or/and I also need to limit "string.Equals" unrolling optimization when we have too many locals already

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

UPD: looks like it's not Span/String.Equals's fault

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

I'm trying another approach by having one local and slicing.

I opened this PR by making change in browser, while my local HEAD was a few days old. Though it still saves 7+ K compared to main, it's no longer dropping System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 list, see the PR description. Looks like some recent change in JIT..

@EgorBo

Copy link
Copy Markdown
Member

Ok, I've bumped the "number of locals JIT can track" limit and it removed all not-inlined methods (all of them are now inlined) and reduced total size of the method in half

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

Looks like some recent change in JIT..

@am11 I think it's either #84530 or #83945

@jeffhandley

Copy link
Copy Markdown
Member

Tagging @dotnet/area-system-formats-asn1 since msftbot was down when the label was applied

Comment on lines +299 to +300
"1.3.132.0.35" => data.Slice(666, 5), // Secp521r1
"2.5.4.3" => data.Slice(671, 3), // CommonName

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a little bothered by how this will make future insertions hard to maintain in the same style. Right now, everything is sorted by the dotted decimal string (or the binary encoding, since they sort the same way). So, if in the future 2.5.4.2 is determined to be common enough to be worth encoding in the table, someone will have to decide between a) putting the new value at the end of the unified blob (being the first unsorted entry) or b) adding 3 to lines 300-321.

That said, adding things to this should be rare; so the savings might pay for the future frustration.

@adamsitnikadamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That said, adding things to this should be rare; so the savings might pay for the future frustration.

I agree with @bartonjs

I wrote a simple console app to verify that the change is not introducing any bug:

Details
namespaceWellKnownTests{internalclassProgram{staticvoidMain(string[]args){Test("1.2.840.10040.4.1");Test("1.2.840.10040.4.3");Test("1.2.840.10045.2.1");Test("1.2.840.10045.1.1");Test("1.2.840.10045.1.2");Test("1.2.840.10045.3.1.7");Test("1.2.840.10045.4.1");Test("1.2.840.10045.4.3.2");Test("1.2.840.10045.4.3.3");Test("1.2.840.10045.4.3.4");Test("1.2.840.113549.1.1.1");Test("1.2.840.113549.1.1.5");Test("1.2.840.113549.1.1.7");Test("1.2.840.113549.1.1.8");Test("1.2.840.113549.1.1.9");Test("1.2.840.113549.1.1.10");Test("1.2.840.113549.1.1.11");Test("1.2.840.113549.1.1.12");Test("1.2.840.113549.1.1.13");Test("1.2.840.113549.1.5.3");Test("1.2.840.113549.1.5.10");Test("1.2.840.113549.1.5.11");Test("1.2.840.113549.1.5.12");Test("1.2.840.113549.1.5.13");Test("1.2.840.113549.1.7.1");Test("1.2.840.113549.1.7.2");Test("1.2.840.113549.1.7.3");Test("1.2.840.113549.1.7.6");Test("1.2.840.113549.1.9.1");Test("1.2.840.113549.1.9.3");Test("1.2.840.113549.1.9.4");Test("1.2.840.113549.1.9.5");Test("1.2.840.113549.1.9.6");Test("1.2.840.113549.1.9.7");Test("1.2.840.113549.1.9.14");Test("1.2.840.113549.1.9.15");Test("1.2.840.113549.1.9.16.1.4");Test("1.2.840.113549.1.9.16.2.12");Test("1.2.840.113549.1.9.16.2.14");Test("1.2.840.113549.1.9.16.2.47");Test("1.2.840.113549.1.9.20");Test("1.2.840.113549.1.9.21");Test("1.2.840.113549.1.9.22.1");Test("1.2.840.113549.1.12.1.3");Test("1.2.840.113549.1.12.1.5");Test("1.2.840.113549.1.12.1.6");Test("1.2.840.113549.1.12.10.1.1");Test("1.2.840.113549.1.12.10.1.2");Test("1.2.840.113549.1.12.10.1.3");Test("1.2.840.113549.1.12.10.1.5");Test("1.2.840.113549.1.12.10.1.6");Test("1.2.840.113549.2.5");Test("1.2.840.113549.2.7");Test("1.2.840.113549.2.9");Test("1.2.840.113549.2.10");Test("1.2.840.113549.2.11");Test("1.2.840.113549.3.2");Test("1.2.840.113549.3.7");Test("1.3.6.1.4.1.311.17.1");Test("1.3.6.1.4.1.311.17.3.20");Test("1.3.6.1.4.1.311.20.2.3");Test("1.3.6.1.4.1.311.88.2.1");Test("1.3.6.1.4.1.311.88.2.2");Test("1.3.6.1.5.5.7.3.1");Test("1.3.6.1.5.5.7.3.2");Test("1.3.6.1.5.5.7.3.3");Test("1.3.6.1.5.5.7.3.4");Test("1.3.6.1.5.5.7.3.8");Test("1.3.6.1.5.5.7.3.9");Test("1.3.6.1.5.5.7.6.2");Test("1.3.6.1.5.5.7.48.1");Test("1.3.6.1.5.5.7.48.1.2");Test("1.3.6.1.5.5.7.48.2");Test("1.3.14.3.2.26");Test("1.3.14.3.2.7");Test("1.3.132.0.34");Test("1.3.132.0.35");Test("2.5.4.3");Test("2.5.4.5");Test("2.5.4.6");Test("2.5.4.7");Test("2.5.4.8");Test("2.5.4.10");Test("2.5.4.11");Test("2.5.4.97");Test("2.5.29.14");Test("2.5.29.15");Test("2.5.29.17");Test("2.5.29.19");Test("2.5.29.20");Test("2.5.29.35");Test("2.16.840.1.101.3.4.1.2");Test("2.16.840.1.101.3.4.1.22");Test("2.16.840.1.101.3.4.1.42");Test("2.16.840.1.101.3.4.2.1");Test("2.16.840.1.101.3.4.2.2");Test("2.16.840.1.101.3.4.2.3");Test("2.23.140.1.2.1");Test("2.23.140.1.2.2");staticvoidTest(stringvalue){ReadOnlySpan<byte>mainContents=WellKnownOids_Main.GetContents(value);ReadOnlySpan<byte>prContents=WellKnownOids_PR.GetContents(value);if(!mainContents.SequenceEqual(prContents)){thrownewException($"GetContents Bug for {value}");}string?mainValue=WellKnownOids_Main.GetValue(mainContents);string?prValue=WellKnownOids_PR.GetValue(prContents);if(prValue!=mainValue){thrownewException($"GetValue Bug for {value}");}}}}internalstaticclassWellKnownOids_Main{privatestaticReadOnlySpan<byte>DSA=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,};privatestaticReadOnlySpan<byte>DSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,};privatestaticReadOnlySpan<byte>EC=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,};privatestaticReadOnlySpan<byte>EcPrimeField=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,};privatestaticReadOnlySpan<byte>EcChar2Field=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,};privatestaticReadOnlySpan<byte>Secp256r1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,};privatestaticReadOnlySpan<byte>ECDSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,};privatestaticReadOnlySpan<byte>ECDSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,};privatestaticReadOnlySpan<byte>ECDSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,};privatestaticReadOnlySpan<byte>ECDSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,};privatestaticReadOnlySpan<byte>RSA=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,};privatestaticReadOnlySpan<byte>RSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,};privatestaticReadOnlySpan<byte>RSAOAEP=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,};privatestaticReadOnlySpan<byte>MGF1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,};privatestaticReadOnlySpan<byte>OaepPSpecified=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,};privatestaticReadOnlySpan<byte>RSAPSS=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,};privatestaticReadOnlySpan<byte>RSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,};privatestaticReadOnlySpan<byte>RSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,};privatestaticReadOnlySpan<byte>RSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,};privatestaticReadOnlySpan<byte>PbeWithMD5AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,};privatestaticReadOnlySpan<byte>PbeWithSha1AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,};privatestaticReadOnlySpan<byte>PbeWithSha1AndRC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,};privatestaticReadOnlySpan<byte>Pbkdf2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,};privatestaticReadOnlySpan<byte>PasswordBasedEncryptionScheme2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,};privatestaticReadOnlySpan<byte>Pkcs7Data=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,};privatestaticReadOnlySpan<byte>Pkcs7SignedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,};privatestaticReadOnlySpan<byte>Pkcs7EnvelopedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,};privatestaticReadOnlySpan<byte>Pkcs7EncryptedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,};privatestaticReadOnlySpan<byte>Pkcs9EmailAddress=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,};privatestaticReadOnlySpan<byte>Pkcs9ContentType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,};privatestaticReadOnlySpan<byte>Pkcs9MessageDigest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,};privatestaticReadOnlySpan<byte>Pkcs9SigningTime=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,};privatestaticReadOnlySpan<byte>Pkcs9CounterSigner=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,};privatestaticReadOnlySpan<byte>Pkcs9Challenge=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,};privatestaticReadOnlySpan<byte>Pkcs9ExtensionRequest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,};privatestaticReadOnlySpan<byte>Pkcs9SMimeCapabilities=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,};privatestaticReadOnlySpan<byte>TstInfo=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,};privatestaticReadOnlySpan<byte>SigningCertificateAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,};privatestaticReadOnlySpan<byte>SignatureTimeStampAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,};privatestaticReadOnlySpan<byte>SigningCertificateV2Attr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,};privatestaticReadOnlySpan<byte>Pkcs9FriendlyName=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,};privatestaticReadOnlySpan<byte>LocalKeyId=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,};privatestaticReadOnlySpan<byte>Pkcs12X509CertType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,};privatestaticReadOnlySpan<byte>Pkcs12TripleDes=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc128=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc40=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,};privatestaticReadOnlySpan<byte>Pkcs12KeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,};privatestaticReadOnlySpan<byte>Pkcs12ShroudedKeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,};privatestaticReadOnlySpan<byte>Pkcs12CertBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12SecretBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12SafeContentsBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,};privatestaticReadOnlySpan<byte>MD5=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,};privatestaticReadOnlySpan<byte>HMACSHA1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,};privatestaticReadOnlySpan<byte>HMACSHA256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,};privatestaticReadOnlySpan<byte>HMACSHA384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,};privatestaticReadOnlySpan<byte>HMACSHA512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,};privatestaticReadOnlySpan<byte>RC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,};privatestaticReadOnlySpan<byte>TripleDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,};privatestaticReadOnlySpan<byte>Pkcs12KeyProviderName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,};privatestaticReadOnlySpan<byte>KeyIdentifier=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,};privatestaticReadOnlySpan<byte>UserPrincipalName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,};privatestaticReadOnlySpan<byte>DocumentNameAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,};privatestaticReadOnlySpan<byte>DocumentDescriptionAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeTlsServer=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,};privatestaticReadOnlySpan<byte>KeyPurposeTlsClient=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeCodeSign=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,};privatestaticReadOnlySpan<byte>KeyPurposeEmailProtection=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,};privatestaticReadOnlySpan<byte>KeyPurposeTimestamping=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,};privatestaticReadOnlySpan<byte>KeyPurposeOcspSigner=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,};privatestaticReadOnlySpan<byte>Pkcs7NoSignature=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,};privatestaticReadOnlySpan<byte>OCSP=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,};privatestaticReadOnlySpan<byte>OcspNonce=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,};privatestaticReadOnlySpan<byte>CAIssuers=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,};privatestaticReadOnlySpan<byte>SHA1=>newbyte[]{0x2B,0x0E,0x03,0x02,0x1A,};privatestaticReadOnlySpan<byte>DES=>newbyte[]{0x2B,0x0E,0x03,0x02,0x07,};privatestaticReadOnlySpan<byte>Secp384r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x22,};privatestaticReadOnlySpan<byte>Secp521r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x23,};privatestaticReadOnlySpan<byte>CommonName=>newbyte[]{0x55,0x04,0x03,};privatestaticReadOnlySpan<byte>SerialNumber=>newbyte[]{0x55,0x04,0x05,};privatestaticReadOnlySpan<byte>CountryOrRegionName=>newbyte[]{0x55,0x04,0x06,};privatestaticReadOnlySpan<byte>Locality=>newbyte[]{0x55,0x04,0x07,};privatestaticReadOnlySpan<byte>StateOrProvinceName=>newbyte[]{0x55,0x04,0x08,};privatestaticReadOnlySpan<byte>OrganizationName=>newbyte[]{0x55,0x04,0x0A,};privatestaticReadOnlySpan<byte>OrganizationalUnit=>newbyte[]{0x55,0x04,0x0B,};privatestaticReadOnlySpan<byte>OrganizationIdentifier=>newbyte[]{0x55,0x04,0x61,};privatestaticReadOnlySpan<byte>SubjectKeyIdentifier=>newbyte[]{0x55,0x1D,0x0E,};privatestaticReadOnlySpan<byte>KeyUsage=>newbyte[]{0x55,0x1D,0x0F,};privatestaticReadOnlySpan<byte>SubjectAlternativeName=>newbyte[]{0x55,0x1D,0x11,};privatestaticReadOnlySpan<byte>BasicConstraints=>newbyte[]{0x55,0x1D,0x13,};privatestaticReadOnlySpan<byte>CrlNumber=>newbyte[]{0x55,0x1D,0x14,};privatestaticReadOnlySpan<byte>AuthorityKeyIdentifier=>newbyte[]{0x55,0x1D,0x23,};privatestaticReadOnlySpan<byte>Aes128Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,};privatestaticReadOnlySpan<byte>Aes192Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,};privatestaticReadOnlySpan<byte>Aes256Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,};privatestaticReadOnlySpan<byte>Sha256=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,};privatestaticReadOnlySpan<byte>Sha384=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,};privatestaticReadOnlySpan<byte>Sha512=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,};privatestaticReadOnlySpan<byte>CabForumDV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x01,};privatestaticReadOnlySpan<byte>CabForumOV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x02,};internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){returnvalueswitch{"1.2.840.10040.4.1"=>DSA,"1.2.840.10040.4.3"=>DSAWithSha1,"1.2.840.10045.2.1"=>EC,"1.2.840.10045.1.1"=>EcPrimeField,"1.2.840.10045.1.2"=>EcChar2Field,"1.2.840.10045.3.1.7"=>Secp256r1,"1.2.840.10045.4.1"=>ECDSAWithSha1,"1.2.840.10045.4.3.2"=>ECDSAWithSha256,"1.2.840.10045.4.3.3"=>ECDSAWithSha384,"1.2.840.10045.4.3.4"=>ECDSAWithSha512,"1.2.840.113549.1.1.1"=>RSA,"1.2.840.113549.1.1.5"=>RSAWithSha1,"1.2.840.113549.1.1.7"=>RSAOAEP,"1.2.840.113549.1.1.8"=>MGF1,"1.2.840.113549.1.1.9"=>OaepPSpecified,"1.2.840.113549.1.1.10"=>RSAPSS,"1.2.840.113549.1.1.11"=>RSAWithSha256,"1.2.840.113549.1.1.12"=>RSAWithSha384,"1.2.840.113549.1.1.13"=>RSAWithSha512,"1.2.840.113549.1.5.3"=>PbeWithMD5AndDESCBC,"1.2.840.113549.1.5.10"=>PbeWithSha1AndDESCBC,"1.2.840.113549.1.5.11"=>PbeWithSha1AndRC2CBC,"1.2.840.113549.1.5.12"=>Pbkdf2,"1.2.840.113549.1.5.13"=>PasswordBasedEncryptionScheme2,"1.2.840.113549.1.7.1"=>Pkcs7Data,"1.2.840.113549.1.7.2"=>Pkcs7SignedData,"1.2.840.113549.1.7.3"=>Pkcs7EnvelopedData,"1.2.840.113549.1.7.6"=>Pkcs7EncryptedData,"1.2.840.113549.1.9.1"=>Pkcs9EmailAddress,"1.2.840.113549.1.9.3"=>Pkcs9ContentType,"1.2.840.113549.1.9.4"=>Pkcs9MessageDigest,"1.2.840.113549.1.9.5"=>Pkcs9SigningTime,"1.2.840.113549.1.9.6"=>Pkcs9CounterSigner,"1.2.840.113549.1.9.7"=>Pkcs9Challenge,"1.2.840.113549.1.9.14"=>Pkcs9ExtensionRequest,"1.2.840.113549.1.9.15"=>Pkcs9SMimeCapabilities,"1.2.840.113549.1.9.16.1.4"=>TstInfo,"1.2.840.113549.1.9.16.2.12"=>SigningCertificateAttr,"1.2.840.113549.1.9.16.2.14"=>SignatureTimeStampAttr,"1.2.840.113549.1.9.16.2.47"=>SigningCertificateV2Attr,"1.2.840.113549.1.9.20"=>Pkcs9FriendlyName,"1.2.840.113549.1.9.21"=>LocalKeyId,"1.2.840.113549.1.9.22.1"=>Pkcs12X509CertType,"1.2.840.113549.1.12.1.3"=>Pkcs12TripleDes,"1.2.840.113549.1.12.1.5"=>Pkcs12Rc2Cbc128,"1.2.840.113549.1.12.1.6"=>Pkcs12Rc2Cbc40,"1.2.840.113549.1.12.10.1.1"=>Pkcs12KeyBag,"1.2.840.113549.1.12.10.1.2"=>Pkcs12ShroudedKeyBag,"1.2.840.113549.1.12.10.1.3"=>Pkcs12CertBag,"1.2.840.113549.1.12.10.1.5"=>Pkcs12SecretBag,"1.2.840.113549.1.12.10.1.6"=>Pkcs12SafeContentsBag,"1.2.840.113549.2.5"=>MD5,"1.2.840.113549.2.7"=>HMACSHA1,"1.2.840.113549.2.9"=>HMACSHA256,"1.2.840.113549.2.10"=>HMACSHA384,"1.2.840.113549.2.11"=>HMACSHA512,"1.2.840.113549.3.2"=>RC2CBC,"1.2.840.113549.3.7"=>TripleDESCBC,"1.3.6.1.4.1.311.17.1"=>Pkcs12KeyProviderName,"1.3.6.1.4.1.311.17.3.20"=>KeyIdentifier,"1.3.6.1.4.1.311.20.2.3"=>UserPrincipalName,"1.3.6.1.4.1.311.88.2.1"=>DocumentNameAttr,"1.3.6.1.4.1.311.88.2.2"=>DocumentDescriptionAttr,"1.3.6.1.5.5.7.3.1"=>KeyPurposeTlsServer,"1.3.6.1.5.5.7.3.2"=>KeyPurposeTlsClient,"1.3.6.1.5.5.7.3.3"=>KeyPurposeCodeSign,"1.3.6.1.5.5.7.3.4"=>KeyPurposeEmailProtection,"1.3.6.1.5.5.7.3.8"=>KeyPurposeTimestamping,"1.3.6.1.5.5.7.3.9"=>KeyPurposeOcspSigner,"1.3.6.1.5.5.7.6.2"=>Pkcs7NoSignature,"1.3.6.1.5.5.7.48.1"=>OCSP,"1.3.6.1.5.5.7.48.1.2"=>OcspNonce,"1.3.6.1.5.5.7.48.2"=>CAIssuers,"1.3.14.3.2.26"=>SHA1,"1.3.14.3.2.7"=>DES,"1.3.132.0.34"=>Secp384r1,"1.3.132.0.35"=>Secp521r1,"2.5.4.3"=>CommonName,"2.5.4.5"=>SerialNumber,"2.5.4.6"=>CountryOrRegionName,"2.5.4.7"=>Locality,"2.5.4.8"=>StateOrProvinceName,"2.5.4.10"=>OrganizationName,"2.5.4.11"=>OrganizationalUnit,"2.5.4.97"=>OrganizationIdentifier,"2.5.29.14"=>SubjectKeyIdentifier,"2.5.29.15"=>KeyUsage,"2.5.29.17"=>SubjectAlternativeName,"2.5.29.19"=>BasicConstraints,"2.5.29.20"=>CrlNumber,"2.5.29.35"=>AuthorityKeyIdentifier,"2.16.840.1.101.3.4.1.2"=>Aes128Cbc,"2.16.840.1.101.3.4.1.22"=>Aes192Cbc,"2.16.840.1.101.3.4.1.42"=>Aes256Cbc,"2.16.840.1.101.3.4.2.1"=>Sha256,"2.16.840.1.101.3.4.2.2"=>Sha384,"2.16.840.1.101.3.4.2.3"=>Sha512,"2.23.140.1.2.1"=>CabForumDV,"2.23.140.1.2.2"=>CabForumOV,
_ =>ReadOnlySpan<byte>.Empty,};}}internalstaticclassWellKnownOids_PR{internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){ReadOnlySpan<byte>data=newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,// DSA0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,// DSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,// EC0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,// EcPrimeField0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,// EcChar2Field0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,// Secp256r10x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,// ECDSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,// ECDSAWithSha2560x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,// ECDSAWithSha3840x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,// ECDSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,// RSA0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,// RSAWithSha10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,// RSAOAEP0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,// MGF10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,// OaepPSpecified0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,// RSAPSS0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,// RSAWithSha2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,// RSAWithSha3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,// RSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,// PbeWithMD5AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,// PbeWithSha1AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,// PbeWithSha1AndRC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,// Pbkdf20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,// PasswordBasedEncryptionScheme20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,// Pkcs7Data0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,// Pkcs7SignedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,// Pkcs7EnvelopedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,// Pkcs7EncryptedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,// Pkcs9EmailAddress0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,// Pkcs9ContentType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,// Pkcs9MessageDigest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,// Pkcs9SigningTime0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,// Pkcs9CounterSigner0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,// Pkcs9Challenge0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,// Pkcs9ExtensionRequest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,// Pkcs9SMimeCapabilities0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,// TstInfo0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,// SigningCertificateAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,// SignatureTimeStampAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,// SigningCertificateV2Attr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,// Pkcs9FriendlyName0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,// LocalKeyId0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,// Pkcs12X509CertType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,// Pkcs12TripleDes0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,// Pkcs12Rc2Cbc1280x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,// Pkcs12Rc2Cbc400x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,// Pkcs12KeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,// Pkcs12ShroudedKeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,// Pkcs12CertBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,// Pkcs12SecretBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,// Pkcs12SafeContentsBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,// MD50x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,// HMACSHA10x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,// HMACSHA2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,// HMACSHA3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,// HMACSHA5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,// RC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,// TripleDESCBC0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,// Pkcs12KeyProviderName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,// KeyIdentifier0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,// UserPrincipalName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,// DocumentNameAttr0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,// DocumentDescriptionAttr0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,// KeyPurposeTlsServer0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,// KeyPurposeTlsClient0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,// KeyPurposeCodeSign0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,// KeyPurposeEmailProtection0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,// KeyPurposeTimestamping0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,// KeyPurposeOcspSigner0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,// Pkcs7NoSignature0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,// OCSP0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,// OcspNonce0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,// CAIssuers0x2B,0x0E,0x03,0x02,0x1A,// SHA10x2B,0x0E,0x03,0x02,0x07,// DES0x2B,0x81,0x04,0x00,0x22,// Secp384r10x2B,0x81,0x04,0x00,0x23,// Secp521r10x55,0x04,0x03,// CommonName0x55,0x04,0x05,// SerialNumber0x55,0x04,0x06,// CountryOrRegionName0x55,0x04,0x07,// Locality0x55,0x04,0x08,// StateOrProvinceName0x55,0x04,0x0A,// OrganizationName0x55,0x04,0x0B,// OrganizationalUnit0x55,0x04,0x61,// OrganizationIdentifier0x55,0x1D,0x0E,// SubjectKeyIdentifier0x55,0x1D,0x0F,// KeyUsage0x55,0x1D,0x11,// SubjectAlternativeName0x55,0x1D,0x13,// BasicConstraints0x55,0x1D,0x14,// CrlNumber0x55,0x1D,0x23,// AuthorityKeyIdentifier0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,// Aes128Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,// Aes192Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,// Aes256Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,// Sha2560x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,// Sha3840x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,// Sha5120x67,0x81,0x0C,0x01,0x02,0x01,// CabForumDV0x67,0x81,0x0C,0x01,0x02,0x02,// CabForumOV};returnvalueswitch{"1.2.840.10040.4.1"=>data.Slice(0,7),// DSA"1.2.840.10040.4.3"=>data.Slice(7,7),// DSAWithSha1"1.2.840.10045.2.1"=>data.Slice(14,7),// EC"1.2.840.10045.1.1"=>data.Slice(21,7),// EcPrimeField"1.2.840.10045.1.2"=>data.Slice(28,7),// EcChar2Field"1.2.840.10045.3.1.7"=>data.Slice(35,8),// Secp256r1"1.2.840.10045.4.1"=>data.Slice(43,7),// ECDSAWithSha1"1.2.840.10045.4.3.2"=>data.Slice(50,8),// ECDSAWithSha256"1.2.840.10045.4.3.3"=>data.Slice(58,8),// ECDSAWithSha384"1.2.840.10045.4.3.4"=>data.Slice(66,8),// ECDSAWithSha512"1.2.840.113549.1.1.1"=>data.Slice(74,9),// RSA"1.2.840.113549.1.1.5"=>data.Slice(83,9),// RSAWithSha1"1.2.840.113549.1.1.7"=>data.Slice(92,9),// RSAOAEP"1.2.840.113549.1.1.8"=>data.Slice(101,9),// MGF1"1.2.840.113549.1.1.9"=>data.Slice(110,9),// OaepPSpecified"1.2.840.113549.1.1.10"=>data.Slice(119,9),// RSAPSS"1.2.840.113549.1.1.11"=>data.Slice(128,9),// RSAWithSha256"1.2.840.113549.1.1.12"=>data.Slice(137,9),// RSAWithSha384"1.2.840.113549.1.1.13"=>data.Slice(146,9),// RSAWithSha512"1.2.840.113549.1.5.3"=>data.Slice(155,9),// PbeWithMD5AndDESCBC"1.2.840.113549.1.5.10"=>data.Slice(164,9),// PbeWithSha1AndDESCBC"1.2.840.113549.1.5.11"=>data.Slice(173,9),// PbeWithSha1AndRC2CBC"1.2.840.113549.1.5.12"=>data.Slice(182,9),// Pbkdf2"1.2.840.113549.1.5.13"=>data.Slice(191,9),// PasswordBasedEncryptionScheme2"1.2.840.113549.1.7.1"=>data.Slice(200,9),// Pkcs7Data"1.2.840.113549.1.7.2"=>data.Slice(209,9),// Pkcs7SignedData"1.2.840.113549.1.7.3"=>data.Slice(218,9),// Pkcs7EnvelopedData"1.2.840.113549.1.7.6"=>data.Slice(227,9),// Pkcs7EncryptedData"1.2.840.113549.1.9.1"=>data.Slice(236,9),// Pkcs9EmailAddress"1.2.840.113549.1.9.3"=>data.Slice(245,9),// Pkcs9ContentType"1.2.840.113549.1.9.4"=>data.Slice(254,9),// Pkcs9MessageDigest"1.2.840.113549.1.9.5"=>data.Slice(263,9),// Pkcs9SigningTime"1.2.840.113549.1.9.6"=>data.Slice(272,9),// Pkcs9CounterSigner"1.2.840.113549.1.9.7"=>data.Slice(281,9),// Pkcs9Challenge"1.2.840.113549.1.9.14"=>data.Slice(290,9),// Pkcs9ExtensionRequest"1.2.840.113549.1.9.15"=>data.Slice(299,9),// Pkcs9SMimeCapabilities"1.2.840.113549.1.9.16.1.4"=>data.Slice(308,11),// TstInfo"1.2.840.113549.1.9.16.2.12"=>data.Slice(319,11),// SigningCertificateAttr"1.2.840.113549.1.9.16.2.14"=>data.Slice(330,11),// SignatureTimeStampAttr"1.2.840.113549.1.9.16.2.47"=>data.Slice(341,11),// SigningCertificateV2Attr"1.2.840.113549.1.9.20"=>data.Slice(352,9),// Pkcs9FriendlyName"1.2.840.113549.1.9.21"=>data.Slice(361,9),// LocalKeyId"1.2.840.113549.1.9.22.1"=>data.Slice(370,10),// Pkcs12X509CertType"1.2.840.113549.1.12.1.3"=>data.Slice(380,10),// Pkcs12TripleDes"1.2.840.113549.1.12.1.5"=>data.Slice(390,10),// Pkcs12Rc2Cbc128"1.2.840.113549.1.12.1.6"=>data.Slice(400,10),// Pkcs12Rc2Cbc40"1.2.840.113549.1.12.10.1.1"=>data.Slice(410,11),// Pkcs12KeyBag"1.2.840.113549.1.12.10.1.2"=>data.Slice(421,11),// Pkcs12ShroudedKeyBag"1.2.840.113549.1.12.10.1.3"=>data.Slice(432,11),// Pkcs12CertBag"1.2.840.113549.1.12.10.1.5"=>data.Slice(443,11),// Pkcs12SecretBag"1.2.840.113549.1.12.10.1.6"=>data.Slice(454,11),// Pkcs12SafeContentsBag"1.2.840.113549.2.5"=>data.Slice(465,8),// MD5"1.2.840.113549.2.7"=>data.Slice(473,8),// HMACSHA1"1.2.840.113549.2.9"=>data.Slice(481,8),// HMACSHA256"1.2.840.113549.2.10"=>data.Slice(489,8),// HMACSHA384"1.2.840.113549.2.11"=>data.Slice(497,8),// HMACSHA512"1.2.840.113549.3.2"=>data.Slice(505,8),// RC2CBC"1.2.840.113549.3.7"=>data.Slice(513,8),// TripleDESCBC"1.3.6.1.4.1.311.17.1"=>data.Slice(521,9),// Pkcs12KeyProviderName"1.3.6.1.4.1.311.17.3.20"=>data.Slice(530,10),// KeyIdentifier"1.3.6.1.4.1.311.20.2.3"=>data.Slice(540,10),// UserPrincipalName"1.3.6.1.4.1.311.88.2.1"=>data.Slice(550,10),// DocumentNameAttr"1.3.6.1.4.1.311.88.2.2"=>data.Slice(560,10),// DocumentDescriptionAttr"1.3.6.1.5.5.7.3.1"=>data.Slice(570,8),// KeyPurposeTlsServer"1.3.6.1.5.5.7.3.2"=>data.Slice(578,8),// KeyPurposeTlsClient"1.3.6.1.5.5.7.3.3"=>data.Slice(586,8),// KeyPurposeCodeSign"1.3.6.1.5.5.7.3.4"=>data.Slice(594,8),// KeyPurposeEmailProtection"1.3.6.1.5.5.7.3.8"=>data.Slice(602,8),// KeyPurposeTimestamping"1.3.6.1.5.5.7.3.9"=>data.Slice(610,8),// KeyPurposeOcspSigner"1.3.6.1.5.5.7.6.2"=>data.Slice(618,8),// Pkcs7NoSignature"1.3.6.1.5.5.7.48.1"=>data.Slice(626,8),// OCSP"1.3.6.1.5.5.7.48.1.2"=>data.Slice(634,9),// OcspNonce"1.3.6.1.5.5.7.48.2"=>data.Slice(643,8),// CAIssuers"1.3.14.3.2.26"=>data.Slice(651,5),// SHA1"1.3.14.3.2.7"=>data.Slice(656,5),// DES"1.3.132.0.34"=>data.Slice(661,5),// Secp384r1"1.3.132.0.35"=>data.Slice(666,5),// Secp521r1"2.5.4.3"=>data.Slice(671,3),// CommonName"2.5.4.5"=>data.Slice(674,3),// SerialNumber"2.5.4.6"=>data.Slice(677,3),// CountryOrRegionName"2.5.4.7"=>data.Slice(680,3),// Locality"2.5.4.8"=>data.Slice(683,3),// StateOrProvinceName"2.5.4.10"=>data.Slice(686,3),// OrganizationName"2.5.4.11"=>data.Slice(689,3),// OrganizationalUnit"2.5.4.97"=>data.Slice(692,3),// OrganizationIdentifier"2.5.29.14"=>data.Slice(695,3),// SubjectKeyIdentifier"2.5.29.15"=>data.Slice(698,3),// KeyUsage"2.5.29.17"=>data.Slice(701,3),// SubjectAlternativeName"2.5.29.19"=>data.Slice(704,3),// BasicConstraints"2.5.29.20"=>data.Slice(707,3),// CrlNumber"2.5.29.35"=>data.Slice(710,3),// AuthorityKeyIdentifier"2.16.840.1.101.3.4.1.2"=>data.Slice(713,9),// Aes128Cbc"2.16.840.1.101.3.4.1.22"=>data.Slice(722,9),// Aes192Cbc"2.16.840.1.101.3.4.1.42"=>data.Slice(731,9),// Aes256Cbc"2.16.840.1.101.3.4.2.1"=>data.Slice(740,9),// Sha256"2.16.840.1.101.3.4.2.2"=>data.Slice(749,9),// Sha384"2.16.840.1.101.3.4.2.3"=>data.Slice(758,9),// Sha512"2.23.140.1.2.1"=>data.Slice(767,6),// CabForumDV"2.23.140.1.2.2"=>data.Slice(773,6),// CabForumOV
_ =>ReadOnlySpan<byte>.Empty};}}}

Thank you for your contribution to size reduction @am11 !

@adamsitnikadamsitnik self-assigned this May 17, 2023
@adamsitnik
adamsitnik merged commit 976409d into dotnet:mainMay 17, 2023
@ghostghost locked as resolved and limited conversation to collaborators Jun 16, 2023
@am11
am11 deleted the patch-19 branch June 14, 2024 04:53
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Formats.Asn1size-reductionIssues impacting final app size primary for size sensitive workloads

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@am11@stephentoub@EgorBo@jeffhandley@adamsitnik@bartonjs@teo-tsirpanis
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Restructure WellKnownOids.cs - #84921

Merged
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19
May 17, 2023
Merged

Restructure WellKnownOids.cs#84921
adamsitnik merged 6 commits into
dotnet:mainfrom
am11:patch-19

Conversation

@am11

@am11am11 commented Apr 17, 2023

Copy link
Copy Markdown
Member

By moving private static ROS to local ROS variable and changing switch expression to switch-case syntax, we save 7.3 KB in NativeAOT app.

It removes System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 largest shared framework methods list:

$ ./build.sh clr+libs+packs -c Release -p:IlcGenerateMapFile=true
$ xmlstarlet sel -t -m "//ObjectNodes/MethodCode" -v 'concat(@Length, ": ", @Name)' -n artifacts/obj/coreclr/crossgen2/arm64/Release/native/crossgen2.map.xml |\
sort -nr | head -10 | grep -E ': (System|S_P)_'| xml unescape

@am11am11 added size-reduction Issues impacting final app size primary for size sensitive workloads area-System.Formats.Asn1 and removed area-System.Formats.Asn1 labels Apr 17, 2023
"2.23.140.1.2.1" => CabForumDV,
"2.23.140.1.2.2" => CabForumOV,
_ => ReadOnlySpan<byte>.Empty,
case "1.2.840.10040.4.1": return DSA;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about you inline the new byte[]s?

@stephentoub

stephentoub commented Apr 17, 2023

Copy link
Copy Markdown
Member

It's fine to switch to using local or inline spans, but I'm not a big fan of changing the switch syntax in the name of saving a few bytes based on how it's currently lowered by the C# compiler. What's the impact of just the syntax change? I'd expect it to just be the difference between N stores into a local and one return vs N returns.

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

Reverted the switch-case change.

@stephentoub

Copy link
Copy Markdown
Member

Can you instead structure it like:

returnvalueswitch{"1.2.840.10040.4.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,},// DSA"1.2.840.10040.4.3"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,},// DSAWithSha1"1.2.840.10045.2.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,},// EC"1.2.840.10045.1.1"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,},// EcPrimeField"1.2.840.10045.1.2"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,},// EcChar2Field"1.2.840.10045.3.1.7"=>(ReadOnlySpan<byte>)newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,},// Secp256r1
...

?

@EgorBo

Copy link
Copy Markdown
Member

Part of the problem (I've checked the current impl in this PR) is:

Inlines into System.Formats.Asn1.WellKnownOids:GetContents(System.ReadOnlySpan`1[ushort]):System.ReadOnlySpan`1[ubyte]:
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:.ctor(ulong,int):this
[FAILED: too many locals] System.ReadOnlySpan`1[ubyte]:get_Empty():System.ReadOnlySpan`1[ubyte]

JIT blows up from the number of temp locals, perhaps you can split it into two functions?

@stephentoub

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

@EgorBo

Copy link
Copy Markdown
Member

Does that still happen with #84921 (comment) ?

Looks like it makes it even worse (more locals), presumably, because Roslyn spills it anyway.
We either need to bump the limit of locals JIT can track or/and I also need to limit "string.Equals" unrolling optimization when we have too many locals already

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

UPD: looks like it's not Span/String.Equals's fault

@am11

am11 commented Apr 17, 2023

Copy link
Copy Markdown
MemberAuthor

I'm trying another approach by having one local and slicing.

I opened this PR by making change in browser, while my local HEAD was a few days old. Though it still saves 7+ K compared to main, it's no longer dropping System_Formats_Asn1_System_Formats_Asn1_WellKnownOids__GetContents from top 10 list, see the PR description. Looks like some recent change in JIT..

@EgorBo

Copy link
Copy Markdown
Member

Ok, I've bumped the "number of locals JIT can track" limit and it removed all not-inlined methods (all of them are now inlined) and reduced total size of the method in half

@EgorBo

EgorBo commented Apr 17, 2023

Copy link
Copy Markdown
Member

Looks like some recent change in JIT..

@am11 I think it's either #84530 or #83945

@jeffhandley

Copy link
Copy Markdown
Member

Tagging @dotnet/area-system-formats-asn1 since msftbot was down when the label was applied

Comment on lines +299 to +300
"1.3.132.0.35" => data.Slice(666, 5), // Secp521r1
"2.5.4.3" => data.Slice(671, 3), // CommonName

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a little bothered by how this will make future insertions hard to maintain in the same style. Right now, everything is sorted by the dotted decimal string (or the binary encoding, since they sort the same way). So, if in the future 2.5.4.2 is determined to be common enough to be worth encoding in the table, someone will have to decide between a) putting the new value at the end of the unified blob (being the first unsorted entry) or b) adding 3 to lines 300-321.

That said, adding things to this should be rare; so the savings might pay for the future frustration.

@adamsitnikadamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That said, adding things to this should be rare; so the savings might pay for the future frustration.

I agree with @bartonjs

I wrote a simple console app to verify that the change is not introducing any bug:

Details
namespaceWellKnownTests{internalclassProgram{staticvoidMain(string[]args){Test("1.2.840.10040.4.1");Test("1.2.840.10040.4.3");Test("1.2.840.10045.2.1");Test("1.2.840.10045.1.1");Test("1.2.840.10045.1.2");Test("1.2.840.10045.3.1.7");Test("1.2.840.10045.4.1");Test("1.2.840.10045.4.3.2");Test("1.2.840.10045.4.3.3");Test("1.2.840.10045.4.3.4");Test("1.2.840.113549.1.1.1");Test("1.2.840.113549.1.1.5");Test("1.2.840.113549.1.1.7");Test("1.2.840.113549.1.1.8");Test("1.2.840.113549.1.1.9");Test("1.2.840.113549.1.1.10");Test("1.2.840.113549.1.1.11");Test("1.2.840.113549.1.1.12");Test("1.2.840.113549.1.1.13");Test("1.2.840.113549.1.5.3");Test("1.2.840.113549.1.5.10");Test("1.2.840.113549.1.5.11");Test("1.2.840.113549.1.5.12");Test("1.2.840.113549.1.5.13");Test("1.2.840.113549.1.7.1");Test("1.2.840.113549.1.7.2");Test("1.2.840.113549.1.7.3");Test("1.2.840.113549.1.7.6");Test("1.2.840.113549.1.9.1");Test("1.2.840.113549.1.9.3");Test("1.2.840.113549.1.9.4");Test("1.2.840.113549.1.9.5");Test("1.2.840.113549.1.9.6");Test("1.2.840.113549.1.9.7");Test("1.2.840.113549.1.9.14");Test("1.2.840.113549.1.9.15");Test("1.2.840.113549.1.9.16.1.4");Test("1.2.840.113549.1.9.16.2.12");Test("1.2.840.113549.1.9.16.2.14");Test("1.2.840.113549.1.9.16.2.47");Test("1.2.840.113549.1.9.20");Test("1.2.840.113549.1.9.21");Test("1.2.840.113549.1.9.22.1");Test("1.2.840.113549.1.12.1.3");Test("1.2.840.113549.1.12.1.5");Test("1.2.840.113549.1.12.1.6");Test("1.2.840.113549.1.12.10.1.1");Test("1.2.840.113549.1.12.10.1.2");Test("1.2.840.113549.1.12.10.1.3");Test("1.2.840.113549.1.12.10.1.5");Test("1.2.840.113549.1.12.10.1.6");Test("1.2.840.113549.2.5");Test("1.2.840.113549.2.7");Test("1.2.840.113549.2.9");Test("1.2.840.113549.2.10");Test("1.2.840.113549.2.11");Test("1.2.840.113549.3.2");Test("1.2.840.113549.3.7");Test("1.3.6.1.4.1.311.17.1");Test("1.3.6.1.4.1.311.17.3.20");Test("1.3.6.1.4.1.311.20.2.3");Test("1.3.6.1.4.1.311.88.2.1");Test("1.3.6.1.4.1.311.88.2.2");Test("1.3.6.1.5.5.7.3.1");Test("1.3.6.1.5.5.7.3.2");Test("1.3.6.1.5.5.7.3.3");Test("1.3.6.1.5.5.7.3.4");Test("1.3.6.1.5.5.7.3.8");Test("1.3.6.1.5.5.7.3.9");Test("1.3.6.1.5.5.7.6.2");Test("1.3.6.1.5.5.7.48.1");Test("1.3.6.1.5.5.7.48.1.2");Test("1.3.6.1.5.5.7.48.2");Test("1.3.14.3.2.26");Test("1.3.14.3.2.7");Test("1.3.132.0.34");Test("1.3.132.0.35");Test("2.5.4.3");Test("2.5.4.5");Test("2.5.4.6");Test("2.5.4.7");Test("2.5.4.8");Test("2.5.4.10");Test("2.5.4.11");Test("2.5.4.97");Test("2.5.29.14");Test("2.5.29.15");Test("2.5.29.17");Test("2.5.29.19");Test("2.5.29.20");Test("2.5.29.35");Test("2.16.840.1.101.3.4.1.2");Test("2.16.840.1.101.3.4.1.22");Test("2.16.840.1.101.3.4.1.42");Test("2.16.840.1.101.3.4.2.1");Test("2.16.840.1.101.3.4.2.2");Test("2.16.840.1.101.3.4.2.3");Test("2.23.140.1.2.1");Test("2.23.140.1.2.2");staticvoidTest(stringvalue){ReadOnlySpan<byte>mainContents=WellKnownOids_Main.GetContents(value);ReadOnlySpan<byte>prContents=WellKnownOids_PR.GetContents(value);if(!mainContents.SequenceEqual(prContents)){thrownewException($"GetContents Bug for {value}");}string?mainValue=WellKnownOids_Main.GetValue(mainContents);string?prValue=WellKnownOids_PR.GetValue(prContents);if(prValue!=mainValue){thrownewException($"GetValue Bug for {value}");}}}}internalstaticclassWellKnownOids_Main{privatestaticReadOnlySpan<byte>DSA=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,};privatestaticReadOnlySpan<byte>DSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,};privatestaticReadOnlySpan<byte>EC=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,};privatestaticReadOnlySpan<byte>EcPrimeField=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,};privatestaticReadOnlySpan<byte>EcChar2Field=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,};privatestaticReadOnlySpan<byte>Secp256r1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,};privatestaticReadOnlySpan<byte>ECDSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,};privatestaticReadOnlySpan<byte>ECDSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,};privatestaticReadOnlySpan<byte>ECDSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,};privatestaticReadOnlySpan<byte>ECDSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,};privatestaticReadOnlySpan<byte>RSA=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,};privatestaticReadOnlySpan<byte>RSAWithSha1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,};privatestaticReadOnlySpan<byte>RSAOAEP=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,};privatestaticReadOnlySpan<byte>MGF1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,};privatestaticReadOnlySpan<byte>OaepPSpecified=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,};privatestaticReadOnlySpan<byte>RSAPSS=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,};privatestaticReadOnlySpan<byte>RSAWithSha256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,};privatestaticReadOnlySpan<byte>RSAWithSha384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,};privatestaticReadOnlySpan<byte>RSAWithSha512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,};privatestaticReadOnlySpan<byte>PbeWithMD5AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,};privatestaticReadOnlySpan<byte>PbeWithSha1AndDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,};privatestaticReadOnlySpan<byte>PbeWithSha1AndRC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,};privatestaticReadOnlySpan<byte>Pbkdf2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,};privatestaticReadOnlySpan<byte>PasswordBasedEncryptionScheme2=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,};privatestaticReadOnlySpan<byte>Pkcs7Data=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,};privatestaticReadOnlySpan<byte>Pkcs7SignedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,};privatestaticReadOnlySpan<byte>Pkcs7EnvelopedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,};privatestaticReadOnlySpan<byte>Pkcs7EncryptedData=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,};privatestaticReadOnlySpan<byte>Pkcs9EmailAddress=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,};privatestaticReadOnlySpan<byte>Pkcs9ContentType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,};privatestaticReadOnlySpan<byte>Pkcs9MessageDigest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,};privatestaticReadOnlySpan<byte>Pkcs9SigningTime=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,};privatestaticReadOnlySpan<byte>Pkcs9CounterSigner=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,};privatestaticReadOnlySpan<byte>Pkcs9Challenge=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,};privatestaticReadOnlySpan<byte>Pkcs9ExtensionRequest=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,};privatestaticReadOnlySpan<byte>Pkcs9SMimeCapabilities=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,};privatestaticReadOnlySpan<byte>TstInfo=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,};privatestaticReadOnlySpan<byte>SigningCertificateAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,};privatestaticReadOnlySpan<byte>SignatureTimeStampAttr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,};privatestaticReadOnlySpan<byte>SigningCertificateV2Attr=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,};privatestaticReadOnlySpan<byte>Pkcs9FriendlyName=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,};privatestaticReadOnlySpan<byte>LocalKeyId=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,};privatestaticReadOnlySpan<byte>Pkcs12X509CertType=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,};privatestaticReadOnlySpan<byte>Pkcs12TripleDes=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc128=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12Rc2Cbc40=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,};privatestaticReadOnlySpan<byte>Pkcs12KeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,};privatestaticReadOnlySpan<byte>Pkcs12ShroudedKeyBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,};privatestaticReadOnlySpan<byte>Pkcs12CertBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,};privatestaticReadOnlySpan<byte>Pkcs12SecretBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,};privatestaticReadOnlySpan<byte>Pkcs12SafeContentsBag=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,};privatestaticReadOnlySpan<byte>MD5=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,};privatestaticReadOnlySpan<byte>HMACSHA1=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,};privatestaticReadOnlySpan<byte>HMACSHA256=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,};privatestaticReadOnlySpan<byte>HMACSHA384=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,};privatestaticReadOnlySpan<byte>HMACSHA512=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,};privatestaticReadOnlySpan<byte>RC2CBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,};privatestaticReadOnlySpan<byte>TripleDESCBC=>newbyte[]{0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,};privatestaticReadOnlySpan<byte>Pkcs12KeyProviderName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,};privatestaticReadOnlySpan<byte>KeyIdentifier=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,};privatestaticReadOnlySpan<byte>UserPrincipalName=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,};privatestaticReadOnlySpan<byte>DocumentNameAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,};privatestaticReadOnlySpan<byte>DocumentDescriptionAttr=>newbyte[]{0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeTlsServer=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,};privatestaticReadOnlySpan<byte>KeyPurposeTlsClient=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,};privatestaticReadOnlySpan<byte>KeyPurposeCodeSign=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,};privatestaticReadOnlySpan<byte>KeyPurposeEmailProtection=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,};privatestaticReadOnlySpan<byte>KeyPurposeTimestamping=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,};privatestaticReadOnlySpan<byte>KeyPurposeOcspSigner=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,};privatestaticReadOnlySpan<byte>Pkcs7NoSignature=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,};privatestaticReadOnlySpan<byte>OCSP=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,};privatestaticReadOnlySpan<byte>OcspNonce=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,};privatestaticReadOnlySpan<byte>CAIssuers=>newbyte[]{0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,};privatestaticReadOnlySpan<byte>SHA1=>newbyte[]{0x2B,0x0E,0x03,0x02,0x1A,};privatestaticReadOnlySpan<byte>DES=>newbyte[]{0x2B,0x0E,0x03,0x02,0x07,};privatestaticReadOnlySpan<byte>Secp384r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x22,};privatestaticReadOnlySpan<byte>Secp521r1=>newbyte[]{0x2B,0x81,0x04,0x00,0x23,};privatestaticReadOnlySpan<byte>CommonName=>newbyte[]{0x55,0x04,0x03,};privatestaticReadOnlySpan<byte>SerialNumber=>newbyte[]{0x55,0x04,0x05,};privatestaticReadOnlySpan<byte>CountryOrRegionName=>newbyte[]{0x55,0x04,0x06,};privatestaticReadOnlySpan<byte>Locality=>newbyte[]{0x55,0x04,0x07,};privatestaticReadOnlySpan<byte>StateOrProvinceName=>newbyte[]{0x55,0x04,0x08,};privatestaticReadOnlySpan<byte>OrganizationName=>newbyte[]{0x55,0x04,0x0A,};privatestaticReadOnlySpan<byte>OrganizationalUnit=>newbyte[]{0x55,0x04,0x0B,};privatestaticReadOnlySpan<byte>OrganizationIdentifier=>newbyte[]{0x55,0x04,0x61,};privatestaticReadOnlySpan<byte>SubjectKeyIdentifier=>newbyte[]{0x55,0x1D,0x0E,};privatestaticReadOnlySpan<byte>KeyUsage=>newbyte[]{0x55,0x1D,0x0F,};privatestaticReadOnlySpan<byte>SubjectAlternativeName=>newbyte[]{0x55,0x1D,0x11,};privatestaticReadOnlySpan<byte>BasicConstraints=>newbyte[]{0x55,0x1D,0x13,};privatestaticReadOnlySpan<byte>CrlNumber=>newbyte[]{0x55,0x1D,0x14,};privatestaticReadOnlySpan<byte>AuthorityKeyIdentifier=>newbyte[]{0x55,0x1D,0x23,};privatestaticReadOnlySpan<byte>Aes128Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,};privatestaticReadOnlySpan<byte>Aes192Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,};privatestaticReadOnlySpan<byte>Aes256Cbc=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,};privatestaticReadOnlySpan<byte>Sha256=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,};privatestaticReadOnlySpan<byte>Sha384=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,};privatestaticReadOnlySpan<byte>Sha512=>newbyte[]{0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,};privatestaticReadOnlySpan<byte>CabForumDV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x01,};privatestaticReadOnlySpan<byte>CabForumOV=>newbyte[]{0x67,0x81,0x0C,0x01,0x02,0x02,};internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){returnvalueswitch{"1.2.840.10040.4.1"=>DSA,"1.2.840.10040.4.3"=>DSAWithSha1,"1.2.840.10045.2.1"=>EC,"1.2.840.10045.1.1"=>EcPrimeField,"1.2.840.10045.1.2"=>EcChar2Field,"1.2.840.10045.3.1.7"=>Secp256r1,"1.2.840.10045.4.1"=>ECDSAWithSha1,"1.2.840.10045.4.3.2"=>ECDSAWithSha256,"1.2.840.10045.4.3.3"=>ECDSAWithSha384,"1.2.840.10045.4.3.4"=>ECDSAWithSha512,"1.2.840.113549.1.1.1"=>RSA,"1.2.840.113549.1.1.5"=>RSAWithSha1,"1.2.840.113549.1.1.7"=>RSAOAEP,"1.2.840.113549.1.1.8"=>MGF1,"1.2.840.113549.1.1.9"=>OaepPSpecified,"1.2.840.113549.1.1.10"=>RSAPSS,"1.2.840.113549.1.1.11"=>RSAWithSha256,"1.2.840.113549.1.1.12"=>RSAWithSha384,"1.2.840.113549.1.1.13"=>RSAWithSha512,"1.2.840.113549.1.5.3"=>PbeWithMD5AndDESCBC,"1.2.840.113549.1.5.10"=>PbeWithSha1AndDESCBC,"1.2.840.113549.1.5.11"=>PbeWithSha1AndRC2CBC,"1.2.840.113549.1.5.12"=>Pbkdf2,"1.2.840.113549.1.5.13"=>PasswordBasedEncryptionScheme2,"1.2.840.113549.1.7.1"=>Pkcs7Data,"1.2.840.113549.1.7.2"=>Pkcs7SignedData,"1.2.840.113549.1.7.3"=>Pkcs7EnvelopedData,"1.2.840.113549.1.7.6"=>Pkcs7EncryptedData,"1.2.840.113549.1.9.1"=>Pkcs9EmailAddress,"1.2.840.113549.1.9.3"=>Pkcs9ContentType,"1.2.840.113549.1.9.4"=>Pkcs9MessageDigest,"1.2.840.113549.1.9.5"=>Pkcs9SigningTime,"1.2.840.113549.1.9.6"=>Pkcs9CounterSigner,"1.2.840.113549.1.9.7"=>Pkcs9Challenge,"1.2.840.113549.1.9.14"=>Pkcs9ExtensionRequest,"1.2.840.113549.1.9.15"=>Pkcs9SMimeCapabilities,"1.2.840.113549.1.9.16.1.4"=>TstInfo,"1.2.840.113549.1.9.16.2.12"=>SigningCertificateAttr,"1.2.840.113549.1.9.16.2.14"=>SignatureTimeStampAttr,"1.2.840.113549.1.9.16.2.47"=>SigningCertificateV2Attr,"1.2.840.113549.1.9.20"=>Pkcs9FriendlyName,"1.2.840.113549.1.9.21"=>LocalKeyId,"1.2.840.113549.1.9.22.1"=>Pkcs12X509CertType,"1.2.840.113549.1.12.1.3"=>Pkcs12TripleDes,"1.2.840.113549.1.12.1.5"=>Pkcs12Rc2Cbc128,"1.2.840.113549.1.12.1.6"=>Pkcs12Rc2Cbc40,"1.2.840.113549.1.12.10.1.1"=>Pkcs12KeyBag,"1.2.840.113549.1.12.10.1.2"=>Pkcs12ShroudedKeyBag,"1.2.840.113549.1.12.10.1.3"=>Pkcs12CertBag,"1.2.840.113549.1.12.10.1.5"=>Pkcs12SecretBag,"1.2.840.113549.1.12.10.1.6"=>Pkcs12SafeContentsBag,"1.2.840.113549.2.5"=>MD5,"1.2.840.113549.2.7"=>HMACSHA1,"1.2.840.113549.2.9"=>HMACSHA256,"1.2.840.113549.2.10"=>HMACSHA384,"1.2.840.113549.2.11"=>HMACSHA512,"1.2.840.113549.3.2"=>RC2CBC,"1.2.840.113549.3.7"=>TripleDESCBC,"1.3.6.1.4.1.311.17.1"=>Pkcs12KeyProviderName,"1.3.6.1.4.1.311.17.3.20"=>KeyIdentifier,"1.3.6.1.4.1.311.20.2.3"=>UserPrincipalName,"1.3.6.1.4.1.311.88.2.1"=>DocumentNameAttr,"1.3.6.1.4.1.311.88.2.2"=>DocumentDescriptionAttr,"1.3.6.1.5.5.7.3.1"=>KeyPurposeTlsServer,"1.3.6.1.5.5.7.3.2"=>KeyPurposeTlsClient,"1.3.6.1.5.5.7.3.3"=>KeyPurposeCodeSign,"1.3.6.1.5.5.7.3.4"=>KeyPurposeEmailProtection,"1.3.6.1.5.5.7.3.8"=>KeyPurposeTimestamping,"1.3.6.1.5.5.7.3.9"=>KeyPurposeOcspSigner,"1.3.6.1.5.5.7.6.2"=>Pkcs7NoSignature,"1.3.6.1.5.5.7.48.1"=>OCSP,"1.3.6.1.5.5.7.48.1.2"=>OcspNonce,"1.3.6.1.5.5.7.48.2"=>CAIssuers,"1.3.14.3.2.26"=>SHA1,"1.3.14.3.2.7"=>DES,"1.3.132.0.34"=>Secp384r1,"1.3.132.0.35"=>Secp521r1,"2.5.4.3"=>CommonName,"2.5.4.5"=>SerialNumber,"2.5.4.6"=>CountryOrRegionName,"2.5.4.7"=>Locality,"2.5.4.8"=>StateOrProvinceName,"2.5.4.10"=>OrganizationName,"2.5.4.11"=>OrganizationalUnit,"2.5.4.97"=>OrganizationIdentifier,"2.5.29.14"=>SubjectKeyIdentifier,"2.5.29.15"=>KeyUsage,"2.5.29.17"=>SubjectAlternativeName,"2.5.29.19"=>BasicConstraints,"2.5.29.20"=>CrlNumber,"2.5.29.35"=>AuthorityKeyIdentifier,"2.16.840.1.101.3.4.1.2"=>Aes128Cbc,"2.16.840.1.101.3.4.1.22"=>Aes192Cbc,"2.16.840.1.101.3.4.1.42"=>Aes256Cbc,"2.16.840.1.101.3.4.2.1"=>Sha256,"2.16.840.1.101.3.4.2.2"=>Sha384,"2.16.840.1.101.3.4.2.3"=>Sha512,"2.23.140.1.2.1"=>CabForumDV,"2.23.140.1.2.2"=>CabForumOV,
_ =>ReadOnlySpan<byte>.Empty,};}}internalstaticclassWellKnownOids_PR{internalstaticstring?GetValue(ReadOnlySpan<byte>contents){returncontentsswitch{[0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,]=>"1.2.840.10040.4.1",[0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,]=>"1.2.840.10040.4.3",[0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,]=>"1.2.840.10045.2.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,]=>"1.2.840.10045.1.1",[0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,]=>"1.2.840.10045.1.2",[0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,]=>"1.2.840.10045.3.1.7",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,]=>"1.2.840.10045.4.1",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,]=>"1.2.840.10045.4.3.2",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,]=>"1.2.840.10045.4.3.3",[0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,]=>"1.2.840.10045.4.3.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,]=>"1.2.840.113549.1.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,]=>"1.2.840.113549.1.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,]=>"1.2.840.113549.1.1.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,]=>"1.2.840.113549.1.1.8",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,]=>"1.2.840.113549.1.1.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,]=>"1.2.840.113549.1.1.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,]=>"1.2.840.113549.1.1.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,]=>"1.2.840.113549.1.1.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,]=>"1.2.840.113549.1.1.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,]=>"1.2.840.113549.1.5.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,]=>"1.2.840.113549.1.5.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,]=>"1.2.840.113549.1.5.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,]=>"1.2.840.113549.1.5.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,]=>"1.2.840.113549.1.5.13",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,]=>"1.2.840.113549.1.7.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,]=>"1.2.840.113549.1.7.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,]=>"1.2.840.113549.1.7.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,]=>"1.2.840.113549.1.7.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,]=>"1.2.840.113549.1.9.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,]=>"1.2.840.113549.1.9.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,]=>"1.2.840.113549.1.9.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,]=>"1.2.840.113549.1.9.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,]=>"1.2.840.113549.1.9.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,]=>"1.2.840.113549.1.9.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,]=>"1.2.840.113549.1.9.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,]=>"1.2.840.113549.1.9.15",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,]=>"1.2.840.113549.1.9.16.1.4",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,]=>"1.2.840.113549.1.9.16.2.12",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,]=>"1.2.840.113549.1.9.16.2.14",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,]=>"1.2.840.113549.1.9.16.2.47",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,]=>"1.2.840.113549.1.9.20",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,]=>"1.2.840.113549.1.9.21",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,]=>"1.2.840.113549.1.9.22.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,]=>"1.2.840.113549.1.12.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,]=>"1.2.840.113549.1.12.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,]=>"1.2.840.113549.1.12.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,]=>"1.2.840.113549.1.12.10.1.1",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,]=>"1.2.840.113549.1.12.10.1.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,]=>"1.2.840.113549.1.12.10.1.3",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,]=>"1.2.840.113549.1.12.10.1.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,]=>"1.2.840.113549.1.12.10.1.6",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,]=>"1.2.840.113549.2.5",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,]=>"1.2.840.113549.2.7",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,]=>"1.2.840.113549.2.9",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,]=>"1.2.840.113549.2.10",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,]=>"1.2.840.113549.2.11",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,]=>"1.2.840.113549.3.2",[0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,]=>"1.2.840.113549.3.7",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,]=>"1.3.6.1.4.1.311.17.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,]=>"1.3.6.1.4.1.311.17.3.20",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,]=>"1.3.6.1.4.1.311.20.2.3",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,]=>"1.3.6.1.4.1.311.88.2.1",[0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,]=>"1.3.6.1.4.1.311.88.2.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,]=>"1.3.6.1.5.5.7.3.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,]=>"1.3.6.1.5.5.7.3.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,]=>"1.3.6.1.5.5.7.3.3",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,]=>"1.3.6.1.5.5.7.3.4",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,]=>"1.3.6.1.5.5.7.3.8",[0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,]=>"1.3.6.1.5.5.7.3.9",[0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,]=>"1.3.6.1.5.5.7.6.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,]=>"1.3.6.1.5.5.7.48.1",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,]=>"1.3.6.1.5.5.7.48.1.2",[0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,]=>"1.3.6.1.5.5.7.48.2",[0x2B,0x0E,0x03,0x02,0x1A,]=>"1.3.14.3.2.26",[0x2B,0x0E,0x03,0x02,0x07,]=>"1.3.14.3.2.7",[0x2B,0x81,0x04,0x00,0x22,]=>"1.3.132.0.34",[0x2B,0x81,0x04,0x00,0x23,]=>"1.3.132.0.35",[0x55,0x04,0x03,]=>"2.5.4.3",[0x55,0x04,0x05,]=>"2.5.4.5",[0x55,0x04,0x06,]=>"2.5.4.6",[0x55,0x04,0x07,]=>"2.5.4.7",[0x55,0x04,0x08,]=>"2.5.4.8",[0x55,0x04,0x0A,]=>"2.5.4.10",[0x55,0x04,0x0B,]=>"2.5.4.11",[0x55,0x04,0x61,]=>"2.5.4.97",[0x55,0x1D,0x0E,]=>"2.5.29.14",[0x55,0x1D,0x0F,]=>"2.5.29.15",[0x55,0x1D,0x11,]=>"2.5.29.17",[0x55,0x1D,0x13,]=>"2.5.29.19",[0x55,0x1D,0x14,]=>"2.5.29.20",[0x55,0x1D,0x23,]=>"2.5.29.35",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,]=>"2.16.840.1.101.3.4.1.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,]=>"2.16.840.1.101.3.4.1.22",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,]=>"2.16.840.1.101.3.4.1.42",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,]=>"2.16.840.1.101.3.4.2.1",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,]=>"2.16.840.1.101.3.4.2.2",[0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,]=>"2.16.840.1.101.3.4.2.3",[0x67,0x81,0x0C,0x01,0x02,0x01,]=>"2.23.140.1.2.1",[0x67,0x81,0x0C,0x01,0x02,0x02,]=>"2.23.140.1.2.2",
_ =>null,};}internalstaticReadOnlySpan<byte>GetContents(ReadOnlySpan<char>value){ReadOnlySpan<byte>data=newbyte[]{0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,// DSA0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,// DSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,// EC0x2A,0x86,0x48,0xCE,0x3D,0x01,0x01,// EcPrimeField0x2A,0x86,0x48,0xCE,0x3D,0x01,0x02,// EcChar2Field0x2A,0x86,0x48,0xCE,0x3D,0x03,0x01,0x07,// Secp256r10x2A,0x86,0x48,0xCE,0x3D,0x04,0x01,// ECDSAWithSha10x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x02,// ECDSAWithSha2560x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,// ECDSAWithSha3840x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x04,// ECDSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,// RSA0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,// RSAWithSha10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,// RSAOAEP0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,// MGF10x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x09,// OaepPSpecified0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,// RSAPSS0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,// RSAWithSha2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0C,// RSAWithSha3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0D,// RSAWithSha5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,// PbeWithMD5AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,// PbeWithSha1AndDESCBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,// PbeWithSha1AndRC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,// Pbkdf20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,// PasswordBasedEncryptionScheme20x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,// Pkcs7Data0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,// Pkcs7SignedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,// Pkcs7EnvelopedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,// Pkcs7EncryptedData0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,// Pkcs9EmailAddress0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,// Pkcs9ContentType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,// Pkcs9MessageDigest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,// Pkcs9SigningTime0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,// Pkcs9CounterSigner0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,// Pkcs9Challenge0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,// Pkcs9ExtensionRequest0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,// Pkcs9SMimeCapabilities0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,// TstInfo0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,// SigningCertificateAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,// SignatureTimeStampAttr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x2F,// SigningCertificateV2Attr0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,// Pkcs9FriendlyName0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,// LocalKeyId0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,// Pkcs12X509CertType0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,// Pkcs12TripleDes0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,// Pkcs12Rc2Cbc1280x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,// Pkcs12Rc2Cbc400x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,// Pkcs12KeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,// Pkcs12ShroudedKeyBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,// Pkcs12CertBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,// Pkcs12SecretBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,// Pkcs12SafeContentsBag0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05,// MD50x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07,// HMACSHA10x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x09,// HMACSHA2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0A,// HMACSHA3840x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x0B,// HMACSHA5120x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02,// RC2CBC0x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07,// TripleDESCBC0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x01,// Pkcs12KeyProviderName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x11,0x03,0x14,// KeyIdentifier0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14,0x02,0x03,// UserPrincipalName0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x01,// DocumentNameAttr0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x58,0x02,0x02,// DocumentDescriptionAttr0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01,// KeyPurposeTlsServer0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02,// KeyPurposeTlsClient0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,// KeyPurposeCodeSign0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04,// KeyPurposeEmailProtection0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08,// KeyPurposeTimestamping0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09,// KeyPurposeOcspSigner0x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02,// Pkcs7NoSignature0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,// OCSP0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,// OcspNonce0x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02,// CAIssuers0x2B,0x0E,0x03,0x02,0x1A,// SHA10x2B,0x0E,0x03,0x02,0x07,// DES0x2B,0x81,0x04,0x00,0x22,// Secp384r10x2B,0x81,0x04,0x00,0x23,// Secp521r10x55,0x04,0x03,// CommonName0x55,0x04,0x05,// SerialNumber0x55,0x04,0x06,// CountryOrRegionName0x55,0x04,0x07,// Locality0x55,0x04,0x08,// StateOrProvinceName0x55,0x04,0x0A,// OrganizationName0x55,0x04,0x0B,// OrganizationalUnit0x55,0x04,0x61,// OrganizationIdentifier0x55,0x1D,0x0E,// SubjectKeyIdentifier0x55,0x1D,0x0F,// KeyUsage0x55,0x1D,0x11,// SubjectAlternativeName0x55,0x1D,0x13,// BasicConstraints0x55,0x1D,0x14,// CrlNumber0x55,0x1D,0x23,// AuthorityKeyIdentifier0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x02,// Aes128Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x16,// Aes192Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2A,// Aes256Cbc0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,// Sha2560x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,// Sha3840x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,// Sha5120x67,0x81,0x0C,0x01,0x02,0x01,// CabForumDV0x67,0x81,0x0C,0x01,0x02,0x02,// CabForumOV};returnvalueswitch{"1.2.840.10040.4.1"=>data.Slice(0,7),// DSA"1.2.840.10040.4.3"=>data.Slice(7,7),// DSAWithSha1"1.2.840.10045.2.1"=>data.Slice(14,7),// EC"1.2.840.10045.1.1"=>data.Slice(21,7),// EcPrimeField"1.2.840.10045.1.2"=>data.Slice(28,7),// EcChar2Field"1.2.840.10045.3.1.7"=>data.Slice(35,8),// Secp256r1"1.2.840.10045.4.1"=>data.Slice(43,7),// ECDSAWithSha1"1.2.840.10045.4.3.2"=>data.Slice(50,8),// ECDSAWithSha256"1.2.840.10045.4.3.3"=>data.Slice(58,8),// ECDSAWithSha384"1.2.840.10045.4.3.4"=>data.Slice(66,8),// ECDSAWithSha512"1.2.840.113549.1.1.1"=>data.Slice(74,9),// RSA"1.2.840.113549.1.1.5"=>data.Slice(83,9),// RSAWithSha1"1.2.840.113549.1.1.7"=>data.Slice(92,9),// RSAOAEP"1.2.840.113549.1.1.8"=>data.Slice(101,9),// MGF1"1.2.840.113549.1.1.9"=>data.Slice(110,9),// OaepPSpecified"1.2.840.113549.1.1.10"=>data.Slice(119,9),// RSAPSS"1.2.840.113549.1.1.11"=>data.Slice(128,9),// RSAWithSha256"1.2.840.113549.1.1.12"=>data.Slice(137,9),// RSAWithSha384"1.2.840.113549.1.1.13"=>data.Slice(146,9),// RSAWithSha512"1.2.840.113549.1.5.3"=>data.Slice(155,9),// PbeWithMD5AndDESCBC"1.2.840.113549.1.5.10"=>data.Slice(164,9),// PbeWithSha1AndDESCBC"1.2.840.113549.1.5.11"=>data.Slice(173,9),// PbeWithSha1AndRC2CBC"1.2.840.113549.1.5.12"=>data.Slice(182,9),// Pbkdf2"1.2.840.113549.1.5.13"=>data.Slice(191,9),// PasswordBasedEncryptionScheme2"1.2.840.113549.1.7.1"=>data.Slice(200,9),// Pkcs7Data"1.2.840.113549.1.7.2"=>data.Slice(209,9),// Pkcs7SignedData"1.2.840.113549.1.7.3"=>data.Slice(218,9),// Pkcs7EnvelopedData"1.2.840.113549.1.7.6"=>data.Slice(227,9),// Pkcs7EncryptedData"1.2.840.113549.1.9.1"=>data.Slice(236,9),// Pkcs9EmailAddress"1.2.840.113549.1.9.3"=>data.Slice(245,9),// Pkcs9ContentType"1.2.840.113549.1.9.4"=>data.Slice(254,9),// Pkcs9MessageDigest"1.2.840.113549.1.9.5"=>data.Slice(263,9),// Pkcs9SigningTime"1.2.840.113549.1.9.6"=>data.Slice(272,9),// Pkcs9CounterSigner"1.2.840.113549.1.9.7"=>data.Slice(281,9),// Pkcs9Challenge"1.2.840.113549.1.9.14"=>data.Slice(290,9),// Pkcs9ExtensionRequest"1.2.840.113549.1.9.15"=>data.Slice(299,9),// Pkcs9SMimeCapabilities"1.2.840.113549.1.9.16.1.4"=>data.Slice(308,11),// TstInfo"1.2.840.113549.1.9.16.2.12"=>data.Slice(319,11),// SigningCertificateAttr"1.2.840.113549.1.9.16.2.14"=>data.Slice(330,11),// SignatureTimeStampAttr"1.2.840.113549.1.9.16.2.47"=>data.Slice(341,11),// SigningCertificateV2Attr"1.2.840.113549.1.9.20"=>data.Slice(352,9),// Pkcs9FriendlyName"1.2.840.113549.1.9.21"=>data.Slice(361,9),// LocalKeyId"1.2.840.113549.1.9.22.1"=>data.Slice(370,10),// Pkcs12X509CertType"1.2.840.113549.1.12.1.3"=>data.Slice(380,10),// Pkcs12TripleDes"1.2.840.113549.1.12.1.5"=>data.Slice(390,10),// Pkcs12Rc2Cbc128"1.2.840.113549.1.12.1.6"=>data.Slice(400,10),// Pkcs12Rc2Cbc40"1.2.840.113549.1.12.10.1.1"=>data.Slice(410,11),// Pkcs12KeyBag"1.2.840.113549.1.12.10.1.2"=>data.Slice(421,11),// Pkcs12ShroudedKeyBag"1.2.840.113549.1.12.10.1.3"=>data.Slice(432,11),// Pkcs12CertBag"1.2.840.113549.1.12.10.1.5"=>data.Slice(443,11),// Pkcs12SecretBag"1.2.840.113549.1.12.10.1.6"=>data.Slice(454,11),// Pkcs12SafeContentsBag"1.2.840.113549.2.5"=>data.Slice(465,8),// MD5"1.2.840.113549.2.7"=>data.Slice(473,8),// HMACSHA1"1.2.840.113549.2.9"=>data.Slice(481,8),// HMACSHA256"1.2.840.113549.2.10"=>data.Slice(489,8),// HMACSHA384"1.2.840.113549.2.11"=>data.Slice(497,8),// HMACSHA512"1.2.840.113549.3.2"=>data.Slice(505,8),// RC2CBC"1.2.840.113549.3.7"=>data.Slice(513,8),// TripleDESCBC"1.3.6.1.4.1.311.17.1"=>data.Slice(521,9),// Pkcs12KeyProviderName"1.3.6.1.4.1.311.17.3.20"=>data.Slice(530,10),// KeyIdentifier"1.3.6.1.4.1.311.20.2.3"=>data.Slice(540,10),// UserPrincipalName"1.3.6.1.4.1.311.88.2.1"=>data.Slice(550,10),// DocumentNameAttr"1.3.6.1.4.1.311.88.2.2"=>data.Slice(560,10),// DocumentDescriptionAttr"1.3.6.1.5.5.7.3.1"=>data.Slice(570,8),// KeyPurposeTlsServer"1.3.6.1.5.5.7.3.2"=>data.Slice(578,8),// KeyPurposeTlsClient"1.3.6.1.5.5.7.3.3"=>data.Slice(586,8),// KeyPurposeCodeSign"1.3.6.1.5.5.7.3.4"=>data.Slice(594,8),// KeyPurposeEmailProtection"1.3.6.1.5.5.7.3.8"=>data.Slice(602,8),// KeyPurposeTimestamping"1.3.6.1.5.5.7.3.9"=>data.Slice(610,8),// KeyPurposeOcspSigner"1.3.6.1.5.5.7.6.2"=>data.Slice(618,8),// Pkcs7NoSignature"1.3.6.1.5.5.7.48.1"=>data.Slice(626,8),// OCSP"1.3.6.1.5.5.7.48.1.2"=>data.Slice(634,9),// OcspNonce"1.3.6.1.5.5.7.48.2"=>data.Slice(643,8),// CAIssuers"1.3.14.3.2.26"=>data.Slice(651,5),// SHA1"1.3.14.3.2.7"=>data.Slice(656,5),// DES"1.3.132.0.34"=>data.Slice(661,5),// Secp384r1"1.3.132.0.35"=>data.Slice(666,5),// Secp521r1"2.5.4.3"=>data.Slice(671,3),// CommonName"2.5.4.5"=>data.Slice(674,3),// SerialNumber"2.5.4.6"=>data.Slice(677,3),// CountryOrRegionName"2.5.4.7"=>data.Slice(680,3),// Locality"2.5.4.8"=>data.Slice(683,3),// StateOrProvinceName"2.5.4.10"=>data.Slice(686,3),// OrganizationName"2.5.4.11"=>data.Slice(689,3),// OrganizationalUnit"2.5.4.97"=>data.Slice(692,3),// OrganizationIdentifier"2.5.29.14"=>data.Slice(695,3),// SubjectKeyIdentifier"2.5.29.15"=>data.Slice(698,3),// KeyUsage"2.5.29.17"=>data.Slice(701,3),// SubjectAlternativeName"2.5.29.19"=>data.Slice(704,3),// BasicConstraints"2.5.29.20"=>data.Slice(707,3),// CrlNumber"2.5.29.35"=>data.Slice(710,3),// AuthorityKeyIdentifier"2.16.840.1.101.3.4.1.2"=>data.Slice(713,9),// Aes128Cbc"2.16.840.1.101.3.4.1.22"=>data.Slice(722,9),// Aes192Cbc"2.16.840.1.101.3.4.1.42"=>data.Slice(731,9),// Aes256Cbc"2.16.840.1.101.3.4.2.1"=>data.Slice(740,9),// Sha256"2.16.840.1.101.3.4.2.2"=>data.Slice(749,9),// Sha384"2.16.840.1.101.3.4.2.3"=>data.Slice(758,9),// Sha512"2.23.140.1.2.1"=>data.Slice(767,6),// CabForumDV"2.23.140.1.2.2"=>data.Slice(773,6),// CabForumOV
_ =>ReadOnlySpan<byte>.Empty};}}}

Thank you for your contribution to size reduction @am11 !

@adamsitnikadamsitnik self-assigned this May 17, 2023
@adamsitnik
adamsitnik merged commit 976409d into dotnet:mainMay 17, 2023
@ghostghost locked as resolved and limited conversation to collaborators Jun 16, 2023
@am11
am11 deleted the patch-19 branch June 14, 2024 04:53
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Formats.Asn1size-reductionIssues impacting final app size primary for size sensitive workloads

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@am11@stephentoub@EgorBo@jeffhandley@adamsitnik@bartonjs@teo-tsirpanis