Skip to content

proposal: crypto/x509: create typed versions of ParsePKCS8PrivateKey #26485

Description

@HaraldNordgren

It bothers me that me as an end-user of ParsePKCS8PrivateKey have to do type assertion logic on the key even when you know what you expect.

We should utilize Go's strong type system to create type-specific functions called for example

  • ParsePKCS8PrivateKeyRSA(der []byte) (key *rsa.PrivateKey, err error)
  • ParsePKCS8PrivateKeyECDSA(der []byte) (key *ecdsa.PrivateKey, err error)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ProposalProposal-CryptoProposal related to crypto packages or other security issues

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions