Skip to content

corim verify requires private key #35

@DhanusML

Description

@DhanusML

Verifying a signed CoRIM using the public key gives:

> cocli corim verify -f signed-corim.cbor pub_key.jwk
Error: error loading verifying key from ./pub_key.jwk: argument to AssignIfCompatible() must be compatible with *ecdsa.PublicKey (was *crypto.Signer)

When private key is given as input, verification passes.

This happens because the verify function calls corim.NewPublicKeyFromJWK, which tries to initialize crypto.Signer using just a public key: corim/signer.go:132. This results in an error.

To fix this, either corim.NewPublicKeyFromJWK should be fixed or deserialization logic for JWK should be implemented in cocli.

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