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

LD Key utilities #220

Merged
merged 3 commits into from
Oct 7, 2022
Merged

LD Key utilities #220

merged 3 commits into from
Oct 7, 2022

Conversation

decentralgabe
Copy link
Member

No description provided.

@@ -32,6 +32,10 @@ const (
PS256 SignatureAlgorithm = "PS256"
)

func (kt KeyType) String() string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm more used to .ToString() (java brain here) but if this is the better Go convention we can stick with this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default:
return nil, fmt.Errorf("unsupported key type: %s", kt)
}
return crypto.BytesToPubKey(keyBytes, convertedKeyType)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type {
keyBytes []byte
keyType kt.String() type
}

would a wrapper object give much value? I guess you already have the keytype in hand so maybe not

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm...yeah we have LDKeyType and this is going to KeyType, but the interface that this method is most often being used with is expecting a gocrypto.PublicKey

@decentralgabe decentralgabe merged commit d48966d into main Oct 7, 2022
@decentralgabe decentralgabe deleted the key-utilities branch October 7, 2022 18:00
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

Successfully merging this pull request may close these issues.

None yet

2 participants