nhpip
Hi,
I’ve got a project where I have to decode an X.509 certificate. I’m using Erlang’s public_key module to decode either a PEM or DER file. I get back a beautiful Erlang record. I know I can use Record for this purpose, but that seems overkill. I want to avoid adding yet another library.
Anyone got any recommendations for nicely extracting items out of a nested tuple in Elixir?
Thanks
Trending in Questions
Hi all,
I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
I’m very new to Elixir, so sorry if this is a silly question:
I am wondering what happens to the mailbox of a process when the machine i...
New
How do I tell Hologram not to escape HTML when substituting into templates?
{Textile.render(@product.long_description)}
escapes the HTM...
New
Background
When trying to execute mix release on a Windows 11 machine for a Phoenix project I get the following error:
* assembling mark...
New
I’d like to create a file with 600 permissions (rw-------), but there’s a race condition if I create it and then change the permissions. ...
New
Is there a way to import record definitions in the iex shell for pretty printing (similar to the rr command in the erl shell)? This woul...
New
When I use Mix.install with a git dependency, using git@github.com:... how do I change the SSH identity used?
I’ve got two Github accoun...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #elixirconf-us
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #elixirconf-eu
- #processes
- #security
- #api
- #forms
- #performance










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
D4no0
Pattern matching, using
elem/2, are you looking for anything in particular?I would recommend to use x509 library though, it’s really neat library written by @voltone. When you start decoding things by hand, that code is really hard to comprehend afterwards, better use a well tested library instead IMO.
voltone
You could use
get_in/2andAccess.elem/1, e.g.But I also like @D4no0 's suggestion
nhpip
Thanks. I ended up using the X509 library. Took 5 lines of code.
D4no0
For reference of what I meant by incomprehensible code, take a look at this
: lib/ssl_moon/network/ssl/certificate.ex · main · SSL MOON / SSL MOON · GitLab
ghannam80
thanks for pointing us to this library which is raising actually a question how we can make finding libraries easier
I was looking for something similar a month ago as it is what I need for the below dealing with MC OAUTH keys :
Actually MC have github repositories for other languages like JAVA/Python/..etc but no Elixir or erlang as below :
https://www.npmjs.com/package/mastercard-oauth1-signer
D4no0
This is the problem we are struggling on a daily basis, the best bet now is to ask the community for advice.
Ironically enough with this “AI” hype, this is actually a place where a LLM that would be trained exclusively on documentation of elixir libraries would be excellent.
ghannam80
that is really a good use case , maybe the team can embed it in the forum so similar to what you get when you search the forum , maybe it can auto generate responses and page of details and links , nice idea
nhpip
I was actually playing with using Erlang to turn the thing into a map:
then
voltone
Recent OTP versions support generating code from ASN.1 that produces and accepts maps:
nhpip
That’s pretty cool