Skip to content

how to pass a ES256K key to JWT.decode? #677

Description

@mackuba

Hi,

I'm trying to figure out how to pass an existing public key to JWT.decode for verification. I have the key as a binary string, decoded from a multibase string like this zQ3shMcFGXMMsEX5nxmV8QfBZQc1Uw6mSWADuKSgsvieu5ezC, which passed through Base58 decoder gives me \xE7\x01 and then the actual key.

Now, how do I pass it to JWT.decode… if I pass it as a string that I have (@param key [String] in the comment for JWT.decode suggests that this should work), I get an error undefined method 'group' for an instance of String. So I'm assuming I need to construct some OpenSSL object, but I don't think any example or spec shows this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions