Add the ability to iterate the RDNs in an X500DN
authorJeremy Barton <jbarton@microsoft.com>
Fri, 15 Jul 2022 22:50:51 +0000 (15:50 -0700)
committerGitHub <noreply@github.com>
Fri, 15 Jul 2022 22:50:51 +0000 (15:50 -0700)
commitf40c3403dbb5d92b088ba07983dbb2cfe6b70488
tree457de000428d906a59748f2ebb74035a2c96b6c2
parentb452b4be980b63a0480dd1618fa607d17bbfbab8
Add the ability to iterate the RDNs in an X500DN

Adds X500DistinguishedName.EnumerateRelativeDistinguishedNames and the X500RelativeDistinguishedName type.

It currently identifies multi-valued RDNs without fully supporting them.  Support could be added in the future if there's high demand.

This change also introduces looking up an OID by its encoded pattern without going through the work of decoding it into BigInteger values and a StringBuilder then String.
src/libraries/Common/src/System/Security/Cryptography/Asn1Reader/AsnValueReader.cs
src/libraries/Common/src/System/Security/Cryptography/Oids.Shared.cs
src/libraries/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameTests.cs
src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs
src/libraries/System.Security.Cryptography/src/Resources/Strings.resx
src/libraries/System.Security.Cryptography/src/System.Security.Cryptography.csproj
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X500DictionaryStringHelper.cs
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X500DistinguishedName.cs
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X500RelativeDistinguishedName.cs [new file with mode: 0644]