-
Notifications
You must be signed in to change notification settings - Fork 9
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
Remove gojwk package #41
Conversation
ab25121
to
0d951a9
Compare
|
||
// DecodePublicKey decodes Key to public key. | ||
func (j *Key) DecodePublicKey() (crypto.PublicKey, error) { | ||
if _, ok := supportedKeyTypes[j.Kty]; !ok { |
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.
Just a minor suggestion: I’m not sure if we need a separate supportedKeyTypes
map. Returning an error in the end of the func should be sufficient. Otherwise, we’d need to constantly remember to keep the map updated.
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.
This was done for the future support of EC or other Key types.
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.
My point is we can simplify this and have code something like
switch j.Kty {
case "RSA":
// handle RSA key
case "EC":
// handle ecliptic curve key
default:
return nil, fmt.Errorf("unsupported key type %s", j.Kty)
}
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.
Agreed to improve with the next iteration
16d5dab
to
55a1fba
Compare
As discussed in PM. Part of the dependencies update activity.