Skip to content

Obsolete CryptoConfig.EncodeOID #55579

Closed

Description

@vcsjones

Background and Motivation

Inspired by #54087. We have CryptoConfig.EncodeOID to encoding an OID to ASN.1 DER. However it has a number of quirks in the way that it parses strings.

  • It does not handle the first two arcs correctly (e.g. 41.41.41.41)
  • "Supports" negative arcs.
  • Doesn't handle large integers.
  • etc

Now that there is System.Formats.Asn1, we have better tools for developers to use. I don't see any place within the Libraries that require developers to give us those bytes from EncodeOID, so there does not seem to be a case to keep using it, unless you are unintentionally giving it invalid OIDs.

Proposed API

namespace System.Security.Cryptography {
    public partial class CryptoConfig {
+       [Obsolete("EncodeOID is obsolete. Use the ASN.1 functionality provided in System.Formats.Asn1.")]
        public static byte[] EncodeOID(string str);
    }
}

Activity

  1. added
    api-suggestionEarly API idea and discussion, it is NOT ready for implementation
    on Jul 13, 2021
  2. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Jul 13, 2021
  3. added
    api-ready-for-reviewAPI is ready for review, it is NOT ready for implementation
    and removed
    api-suggestionEarly API idea and discussion, it is NOT ready for implementation
    on Jul 13, 2021
  4. added this to the 6.0.0 milestone on Jul 13, 2021
  5. removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 13, 2021
  6. terrajobst commented on Jul 13, 2021

    @terrajobst
    Contributor
    • Looks good as proposed
    • Just dispense another diagnostic ID :-)
    namespace System.Security.Cryptography
    {
        public partial class CryptoConfig
        {
            [Obsolete("EncodeOID is obsolete. Use the ASN.1 functionality provided in System.Formats.Asn1.")]
            public static byte[] EncodeOID(string str);
        }
    }
  7. added
    api-approvedAPI was approved in API review, it can be implemented
    and removed
    api-ready-for-reviewAPI is ready for review, it is NOT ready for implementation
    on Jul 13, 2021
  8. self-assigned this
    on Jul 13, 2021
  9. bartonjs commented on Jul 13, 2021

    @bartonjs
    Member

    @vcsjones From the self assignment I assume you saw I set this as 6.0 and are starting on it now. 😄

  10. vcsjones commented on Jul 13, 2021

    @vcsjones
    MemberAuthor

    From the self assignment I assume you saw I set this as 6.0 and are starting on it now. 😄

    Almost done.

  11. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jul 13, 2021
  12. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jul 14, 2021
  13. ghost locked as resolved and limited conversation to collaborators on Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions