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

devonestes
Introducing assertions, the library that helps you write really great test assertions! GitHub: https://github.com/devonestes/assertions ...
New
pkrawat1
Presenting Aviacommerce, open source e-commerce platform in Elixir Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
josevalim
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below. Hi everyone, We a...
New
achempion
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library. The progre...
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
Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
mbuhot
EctoJob A transactional job queue built with Ecto, PostgreSQL and GenStage Available on Hex.pm: ecto_job | Hex Docs: API Reference — ec...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
alisinabh
Hey everyone i’ve developed a library for Jalaali calendar for elixir which supports converting Gregorian dates to Jalaali and vice vers...
New
engineeringdept
I’ve just released the first version of Snap, an Elasticsearch client. It borrows ideas about application structure and process managemen...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New

Sub Categories:

We're in Beta

About us Mission Statement