gersonvaldez
Cant to transform private.key to .pem file with X509 library
Hi everyone!! iam getting the next error when i try to use X509.PrivateKey.to_pem
iex(174)> X509.PrivateKey.to_pem(priv, [password: pass])
** (FunctionClauseError) no function clause matching in X509.PrivateKey.pem_entry_encode/2
The following arguments were given to X509.PrivateKey.pem_entry_encode/2:
# 1
<<48, 130, 5, 14, 48, 64, 6, 9, 42, 134, 72, 134, 247, 13, 1, 5, 13, 48, 51, 48,
27, 6, 9, 42, 134, 72, 134, 247, 13, 1, 5, 12, 48, 14, 4, 8, 2, 1, 0, 2, 130,
1, 1, 0, 2, 2, 8, 0, 48, 20, ...>>
# 2
'12345678a'
Attempted function clauses (showing 7 out of 7):
defp pem_entry_encode({:RSAPrivateKey, _, _, _, _, _, _, _, _, _, _} = rsa_private_key, nil)
defp pem_entry_encode({:ECPrivateKey, _, _, _, _, _} = ec_private_key, nil)
defp pem_entry_encode({:PrivateKeyInfo, _, _, _, _} = private_key_info, nil)
defp pem_entry_encode(private_key, password) when is_binary(password)
defp pem_entry_encode({:RSAPrivateKey, _, _, _, _, _, _, _, _, _, _} = rsa_private_key, password)
defp pem_entry_encode({:ECPrivateKey, _, _, _, _, _} = ec_private_key, password)
defp pem_entry_encode({:PrivateKeyInfo, _, _, _, _} = private_key_info, password)
(x509 0.8.5) lib/x509/private_key.ex:281: X509.PrivateKey.pem_entry_encode/2
(x509 0.8.5) lib/x509/private_key.ex:158: X509.PrivateKey.to_pem/2
iex:174: (file)
First Post!
pdgonzalez872
Try passing in a binary (double quotes) as the second arg, seems like you are using a list (single quotes).
Check this out:
iex(1)> i '12345678a'
Term
'12345678a'
Data type
List
Description
This is a list of integers that is printed as a sequence of characters
delimited by single quotes because all the integers in it represent printable
ASCII characters. Conventionally, a list of Unicode code points is known as a
charlist and a list of ASCII characters is a subset of it.
Raw representation
[49, 50, 51, 52, 53, 54, 55, 56, 97]
Reference modules
List
Implemented protocols
Collectable, Enumerable, IEx.Info, Inspect, List.Chars, String.Chars
iex(2)> i List.to_string('12345678a')
Term
"12345678a"
Data type
BitString
Byte size
9
Description
This is a string: a UTF-8 encoded binary. It's printed surrounded by
"double quotes" because all UTF-8 encoded code points in it are printable.
Raw representation
<<49, 50, 51, 52, 53, 54, 55, 56, 97>>
Reference modules
String, :binary
Implemented protocols
Collectable, IEx.Info, Inspect, List.Chars, String.Chars
iex(3)>
Popular in Discussions
So useless benchmarks aside, Its possible to write a webserver that can serve 300k requests per second (perhaps more with optimizations)....
New
It would be nice to be able to define a redirect from one route to another from the router.ex file. E.g.:
redirect "/", UserController, ...
New
In django there is a cache framework backed by memcached. Rails also puts a lot of emphasis on caching, and even the idea of russian-doll...
New
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
There’s a new TIOBE index report that came out that shows Elixir is still not in the top 50 used languages.
It also goes on to call Elix...
New
A couple of days ago I was discussing with a friend about different approaches to write microservices.
He said that if he was going to w...
New
If so I (and hopefully others!) might have some tips for you :slight_smile:
But first, please say which area you’re finding most challen...
New
Release date is May 2017. Can’t wait for it.
New
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something…
Haskell reminds me of Java, and e...
New
Background
A few days ago I was listening to The future of Elixir from Elixir Talks, with Dave Thomas (@pragdave ) and Brian Mitchell.
I...
New
Other popular topics
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode.
The solution seems to be, in a hyphena...
New
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
Hi all,
I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage.
I’m trying to use Postgres...
New
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar.
I p...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)?
Would
mix ecto.rollback -v 200809061...
New
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









