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

Get public key from private key #5

Open
robintemme opened this issue Mar 25, 2016 · 0 comments
Open

Get public key from private key #5

robintemme opened this issue Mar 25, 2016 · 0 comments

Comments

@robintemme
Copy link

In your jwt_backend.go you could retrieve the RSA public key part from the private key, because due to logic and the official GoDocs of rsa.PrivateKey the PublicKey is contained in the PrivateKey. This helps to avoid a lot of action.

Just a suggestion, because I use a similar backend in my current project:

// GetPublicKey returns the rsa public key from the private key
func GetPublicKey(privateKey *rsa.PrivateKey) *rsa.PublicKey {
    return &privateKey.PublicKey
}

Sorry I'm too lazy right now to create a pull request, nonetheless thanks for this project (and the regarding blog post), it helped a lot! 👍 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant