Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
crypto: Remove redundant internal struct x509.rsaPublicKey and replace references with rsa.PublicKey #19355
Perhaps true. I had thought that its use was somewhat idiosyncratic, but it appears to be used only twice, in calls to asn1.Marshal and asn1.Unmarshal.
So perhaps moving it into the asn1 package and possibly renaming it would better indicate its intended use?
We don't put the http2 encoder and decoder in the bytes package just because it's eventually encoded as bytes. I don't see why the asn1 package should contain anything about RSA or x509 or anything else that uses asn.1.
The layering seems good as it is. Closing, but feel free to argue otherwise.
Good point RE not including higher-level structs in codec packages. Wasn't thinking clearly on that.
I'd suggest finally then that the struct in question be renamed
One of the reasons this was confusing to me was probably that it was just hanging out all alone down there at the bottom of the file.
Not going to argue too hard for this though. Handle as you see fit and thanks for taking the time to discuss. Easy enough for me to submit the CL if so desired.
For consistency with the other named types in this package, this change renames the unexported rsaPublicKey struct to pkcs1PublicKey and positions the declaration up with the other similarly-named types in pkcs1.go. See the final comment of #19355 for discussion. Change-Id: I1fa0366a8efa01602b81bc69287ef747abce84f5 Reviewed-on: https://go-review.googlesource.com/37885 Reviewed-by: Brad Fitzpatrick <firstname.lastname@example.org> Run-TryBot: Brad Fitzpatrick <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org>