Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto/x509: Create typed versions of ParsePKCS8PrivateKey #26485

Open
HaraldNordgren opened this Issue Jul 19, 2018 · 5 comments

Comments

Projects
None yet
5 participants
@HaraldNordgren
Copy link
Member

HaraldNordgren commented Jul 19, 2018

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)
@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Jul 19, 2018

Change https://golang.org/cl/125056 mentions this issue: crypto/x509: create typed versions of ParsePKCS8PrivateKey

@bcmills

This comment has been minimized.

Copy link
Member

bcmills commented Jul 19, 2018

@bcmills bcmills added this to the Go1.12 milestone Jul 19, 2018

@HaraldNordgren

This comment has been minimized.

Copy link
Member Author

HaraldNordgren commented Aug 6, 2018

Tagging som people who might be interested in discussing this 😃

@adamdecaf
@agl
@bradfitz
@ianlancetaylor
@martisch
@rsc
@thsnr

@adamdecaf

This comment has been minimized.

Copy link
Contributor

adamdecaf commented Aug 11, 2018

I'm indifferent, but adding new methods adds to the overall api surface, which has its own problems with maintenance.

@adamdecaf

This comment has been minimized.

Copy link
Contributor

adamdecaf commented Aug 11, 2018

@gopherbot proposal-crypto

@andybons andybons modified the milestones: Go1.12, Go1.13 Feb 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.