feat(did): add ToPubKey() and improve crypto tests

This commit is contained in:
Steve Moyer
2024-09-11 07:12:54 -04:00
parent 30be95b20c
commit 64936fd061
3 changed files with 64 additions and 18 deletions

View File

@@ -37,3 +37,12 @@ func FromPubKey(pubKey crypto.PubKey) (DID, error) {
key: true,
}, nil
}
func ToPubKey(s string) (crypto.PubKey, error) {
id, err := Parse(s)
if err != nil {
return nil, err
}
return id.PubKey()
}