# RSA signing with keys in PEM format

**URL:** <https://erlangforums.com/t/rsa-signing-with-keys-in-pem-format/3970>\
**Category:** Questions / Help\
**Tags:** erlang, crypto, openssl\
**Created:** [September 3, 2024, 4:58am UTC](https://erlangforums.com/t/rsa-signing-with-keys-in-pem-format/3970 "2024-09-03T04:58:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KayEss](https://erlangforums.com/letter_avatar_proxy/v4/letter/k/aca169/32.png) [@KayEss](https://erlangforums.com/u/KayEss)\
**Post date:** [September 3, 2024, 4:58am UTC](https://erlangforums.com/t/rsa-signing-with-keys-in-pem-format/3970/1 "2024-09-03T04:58:04Z")

</div>

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/](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.

---

<div class="post-metadata">

**Author:** ![ingela](https://erlangforums.com/letter_avatar_proxy/v4/letter/i/53a042/32.png) [@ingela](https://erlangforums.com/u/ingela)\
**Post date:** [September 3, 2024, 5:36am UTC](https://erlangforums.com/t/rsa-signing-with-keys-in-pem-format/3970/2 "2024-09-03T05:36:31Z")

</div>

You need to decode it further using public\_key:pem\_entry\_decode for examples see:

[Examples — public\_key v1.16.1 (erlang.org)](https://www.erlang.org/doc/apps/public_key/using_public_key.html)
