RSA signing with keys in PEM format

I need to be able to sign (and then verify) using RSA with SHA256. There’s a blog post here https://blog.differentpla.net/blog/2023/02/08/rsa-signing-erlang/ that seems to describe what’s needed, but using public_key:pem_decode gives me something of the format:

[{‘PrivateKeyInfo’, << (long binary) >>, not_encrypted}]

which doesn’t give me the parameters I need. I can’t work out from the documentation how it’s intended to fit these parts together.

You need to decode it further using public_key:pem_entry_decode for examples see:

Examples — public_key v1.16.1 (erlang.org)

1 Like