You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the latest Golang release (1.5.3), the documentation for x509.ParsePKIXPublicKey() says the function takes in a []byte of DER encoded public key and returns pub interface{}. It is not obvious exactly what pub is or how to use it unless digging inside the source code and trace to the function parsePublicKey().
Suggested changes:
Mention explicitly what kind of public key input we support (RSA, DSA, ECDSA)
Mention the type of pub in those three cases respectively
Add a short example on how to use switch statement along with type assertions to obtain the correct type of public key.
I will be happy to make those improvements to the document and submit for code review if no objections from the project maintainers.
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
doc: crypto/x509: Better documentation for ParsePKIXPublicKey()
crypto/x509: better documentation for ParsePKIXPublicKey
Feb 17, 2016
In the latest Golang release (1.5.3), the documentation for x509.ParsePKIXPublicKey() says the function takes in a
[]byte
of DER encoded public key and returnspub interface{}
. It is not obvious exactly whatpub
is or how to use it unless digging inside the source code and trace to the functionparsePublicKey()
.Suggested changes:
pub
in those three cases respectivelyswitch
statement along with type assertions to obtain the correct type of public key.I will be happy to make those improvements to the document and submit for code review if no objections from the project maintainers.
The text was updated successfully, but these errors were encountered: