voltone

voltone

X509 - High-level APIs around certificates, CSRs and key pairs

Erlang/OTP’s :public_key application provides a set of high-level APIs for working with common PKI-related data structures. Under the hood, it supports many more data types, extracted at build time from various standard ASN.1 files. Combining those APIs and the underlying data types to perform common tasks can be a challenge.

The x509 package offers convenient Elixir APIs for:

  • Generating RSA and EC private keys
  • Deriving the public key from a given private key
  • Wrapping and unwrapping keys (e.g. PKCS#8 containers)
  • Creating ‘Relative Distinguished Names’ (e.g. Subject and Issuer names)
  • Creating PKCS#10 CSRs
  • Creating self-signed and issuer-signed RSA and ECDSA certificates with extensions, based on pre-defined or custom templates
  • Exporting and importing entities in PEM and DER format

As a design decision, functions return standard :public_key data types rather than Elixir structs, so the results can be used directly in calls to Erlang/OTP and related libraries.

There is still some work to be done, in documentation and test coverage as well as functional enhancements, but I believe it is in good enough shape for others to start experimenting. Please note that the API may change until it hits 1.0.

Feedback is welcome, both here and as GitHub issues/PRs!

Most Liked

voltone

voltone

Earlier today I released v0.5.0. It includes support for CRLs and it introduces tools to help test TLS clients/servers. Release notes are here.

Enjoy, and do let me know what you’d like to see next…

voltone

voltone

It’s been a while, it appears I have not been posting version announcements here, but I thought I’d let you know that v0.9.0 is now available.

Main feature is compatibility with OTP 28. Some of the internals of Erlang/OTP’s public_key applications were changed, requiring fixes in the package and in OTP itself. Erlang/OTP 28.0 is unfortunately not compatible with this package, but the OTP team recently released 28.0.1 that brought back any functionality that was lost.

Bottom line: if you’re on OTP 28, make sure you use 28.0.1 and use X509 v0.9.0. The package still works with older OTP versions, but this required compile-time conditionals to adapt to the version of public_key in use, so if you compile on OTP <28 your code will not run on OTP >=28 (and vice versa, but that is often the case anyway).

This version also brings support for EdDSA keys (ed25519 and ed448), including in certificates and CSRs.

Release notes are here and full docs are here.

Please note that the current plans for a 1.0 release call for the X509.Test.Suite and X509.Test.Server modules to be extracted into a separate package. Just a heads-up…

voltone

voltone

I just published v0.3.0, which paves the way for some API changes ahead of a 1.0 release. This version does not change any existing APIs, but does introduce new functions that adhere to the new API style. In the next release the return value of existing functions will be changed!

Please have a look at the release notes and start using the new API where possible, so as not to be affected by those upcoming changes.

Sorry for the inconvenience, I just want to make sure I have a clean, consistent and future-proof API in place by the time this hits 1.0.

voltone

voltone

Release v0.4.0 is now available. Please check the release notes for details on breaking changes! Hopefully the API will now be stable until v1.0.

This release includes some fixes for issues that might cause certificate chain verification errors for certificates issued from an intermediate CA, and for ECDSA certificates issued from any CA. Hat tip to @fhunleth and @mobileoverlord for those and other contributions.

Now working on CRL support for 0.5.0.

voltone

voltone

These modules are not meant for unit tests of the package itself, they are tools the package provides for building (automated or manual) test environments, similar to the (defunct?) badssl.com website.

Where Next?

Popular in Libraries Top

mhanberg
I just released the first version of Temple: an HTML DSL for Elixir and Phoenix! You can read this blog post or the docs for more info...
New
Jskalc
Hi! Today, after a couple weeks of development I’ve released v0.1 of LiveVue. It’s a seamless integration of Vue and Phoenix LiveView, i...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
tfwright
After working on it for a couple of months and using it in production for most of that time, today I’ve released LiveAdmin, a LiveView ba...
New
nikokozak
Hello all, I’ve been working on Svonix - a library for quickly integrating Svelte components into Phoenix views. It’s a much-needed succ...
New
tmbb
I’ve published the first version of my Makeup library. It’s a syntax highlighter for Elixir in the spirit of Pygments, Currently it highl...
New
benlime
LiveMotion enables high performance animations declared on the server and run on the client. As a follow up to my previous thread A libr...
New
gabrielpoca
Hello everyone! I want to share with you something that I’m really proud of: https://stillstatic.io/ Still is a static site builder for...
New
mtrudel
Bandit is an HTTP server for Plug and WebSock apps. Bandit is written entirely in Elixir and is built atop Thousand Island. It can serve...
New
mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story &lt;- Meeseeks.all(html, css("tr.athing")) do...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

Sub Categories:

We're in Beta

About us Mission Statement