Skip to content

RS256, public and private keys #291

@jbrayton

Description

@jbrayton

I notice that when generating a token using RS256 and a private key, I can verify that token with either the corresponding public key or the private key.

If I try to generate a token using RS256 and a public key, I get this error (which makes sense):

OpenSSL::PKey::ECError: Private EC key needed!

I want to be certain that either no one can possibly generate a token with RS256 and my public key, or that if they did it would fail verification. Is there a way someone could generate a token using RS256 with my public key? If they can, is there a way I can test that my code + JWT would refuse to verify it?

Thanks, and thank you for this very useful gem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions