diff options
Diffstat (limited to '')
-rw-r--r-- | registry/registry.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/registry/registry.go b/registry/registry.go index 7cdc5dd..25d4360 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -205,10 +205,11 @@ func (r *Registry) Inbox(name string, req *http.Request) error { iter := pubKeyProp.At(0) pubKey := iter.Get() pemProp := pubKey.GetW3IDSecurityV1PublicKeyPem() - pem := pemProp.Get() - logger.With("keyId", keyId).With("pem", pem).Debugf("extracted pem") + pemStr := pemProp.Get() + logger.With("keyId", keyId).With("pem", pemStr).Debugf("extracted pem") + pemObj, _ := pem.Decode([]byte(pemStr)) - decodedKey, err := x509.ParsePKCS1PublicKey([]byte(pem)) + decodedKey, err := x509.ParsePKCS1PublicKey(pemObj.Bytes) if err != nil { return err } |