Skip to content

Get public key from private key #5

@robintemme

Description

@robintemme

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! 👍 🙇

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions