-
Notifications
You must be signed in to change notification settings - Fork 15
Rsa support #3
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
Rsa support #3
Conversation
|
Good work on adding the RSA-based algorithms! Once you add tests for those algorithms we'll look at merging this. |
| var ( | ||
| AlgorithmHmacSha256 = &Algorithm{"hmac-sha256", sha256.New} | ||
| AlgorithmHmacSha1 = &Algorithm{"hmac-sha1", sha1.New} | ||
| AlgorithmHmacSha256 = &Algorithm{"hmac-sha256", sha256.New, hmacSign} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this could use a goimports run over it https://godoc.org/golang.org/x/tools/cmd/goimports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran goimports and go fmt again.
algorithm.go
Outdated
|
|
||
| func parsePrivateKey(pemBytes []byte) (*rsa.PrivateKey, error) { | ||
| block, _ := pem.Decode(pemBytes) | ||
| println(pemBytes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug println left in
|
Added a few tests. First golang project, so more suggestions are welcome |
|
Hey @ElricL, thanks for your work on this! I was just looking for a Go implementation for RSA signature verification. I think the implementation here has a subtle flaw. The primary advantage of RSA signature verification is that the verifier doesn't need access to the private key to verify the signature, only the public key. However, the way it's implemented in this PR, the verifier needs access to the private key. When verifying an I opened a new PR based on this one #11 |
This adds support to sign using Rsa-Sha256 and Rsa-Sha1 algorithms.