# Seeking guidance on generating X.509 certificates in pure Erlang for OTP 28

**URL:** <https://erlangforums.com/t/seeking-guidance-on-generating-x-509-certificates-in-pure-erlang-for-otp-28/5574>\
**Category:** Questions / Help\
**Tags:** quetion\
**Created:** [April 25, 2026, 2:09pm UTC](https://erlangforums.com/t/seeking-guidance-on-generating-x-509-certificates-in-pure-erlang-for-otp-28/5574 "2026-04-25T14:09:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZT-zt-zt-zt](https://erlangforums.com/user_avatar/erlangforums.com/zt-zt-zt-zt/32/3159_2.png) [@ZT-zt-zt-zt](https://erlangforums.com/u/ZT-zt-zt-zt)\
**Post date:** [April 25, 2026, 2:09pm UTC](https://erlangforums.com/t/seeking-guidance-on-generating-x-509-certificates-in-pure-erlang-for-otp-28/5574/1 "2026-04-25T14:09:06Z")

</div>

Hello Erlang/OTP team,

I’m evaluating the X.509 certificate generation capabilities of Erlang/OTP. My goal is to:

- Generate a self-signed Root CA certificate.

- Use that Root CA to issue a child certificate with Subject Alternative Name (SAN) extensions.

**My findings:**

- **Old methods no longer work:** The previous approach based on the internal `erl_make_certs.erl` module worked on OTP 25, but fails on OTP 28 (screenshot attached).

- **Official API still exists:** The documentation for `public_key:pkix_sign/2` indicates it can sign an `OTPTBSCertificate`, which appears to be the core API for certificate signing.

- **Official documentation recommends external tools:** The official “Creating Certificates” guide currently suggests using the `openssl` command-line tool to generate test certificates, rather than pure Erlang code.

**My questions:**

1. In OTP 28, is `public_key:pkix_sign/2` still the recommended API for signing `OTPTBSCertificate` records?

2. Is there an officially maintained, updated code example (like a pure Erlang replacement for `erl_make_certs.erl`) that demonstrates the complete certificate generation workflow?

3. The community-driven `x509` library is mentioned in the official documentation. It appears to be a high-level wrapper built on top of the `public_key` API. Is it considered the current best practice in the ecosystem?

I’d appreciate your guidance. Thank you very much!

😃

> **[public\_key — public\_key v1.20.3](https://www.erlang.org/doc/apps/public_key/public_key.html)**

---

<div class="post-metadata">

**Author:** ![rlipscombe](https://erlangforums.com/user_avatar/erlangforums.com/rlipscombe/32/459_2.png) [@rlipscombe](https://erlangforums.com/u/rlipscombe)\
**Post date:** [April 27, 2026, 8:09am UTC](https://erlangforums.com/t/seeking-guidance-on-generating-x-509-certificates-in-pure-erlang-for-otp-28/5574/2 "2026-04-27T08:09:53Z")

</div>

If you’re using Elixir, then I’d highly recommend `x509`. If you’re using pure Erlang, I wrote this: [GitHub - rlipscombe/erl509: Erlang library for working with X.509 certificates · GitHub](https://github.com/rlipscombe/erl509)
