[erlang-questions] Dealing with public/private keys stored in *.pem files

Daniel Kwiecinski <>
Thu Jan 31 15:12:22 CET 2008


Eshell V5.5.5  (abort with ^G)
1> ssl_pkix:decode_rsa_keyfile("public.pem").
** exited: {undef,[{ssl_pkix,decode_rsa_keyfile,["public.pem"]},
                   {erl_eval,do_apply,5},
                   {shell,exprs,6},
                   {shell,eval_loop,3}]} **

=ERROR REPORT==== 31-Jan-2008::14:11:10 ===
Error in process <0.31.0> with exit value:
{undef,[{ssl_pkix,decode_rsa_keyfile,["public.pem
"]},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]}

2> ssl_pkix:decode_cert_file("public.pem", [pem]).

=ERROR REPORT==== 31-Jan-2008::14:11:22 ===
Error in process <0.33.0> with exit value:
{{badmatch,{ok,[]}},[{ssl_pkix,decode_cert_file,2},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]}

** exited: {{badmatch,{ok,[]}},
            [{ssl_pkix,decode_cert_file,2},
             {erl_eval,do_apply,5},
             {shell,exprs,6},
             {shell,eval_loop,3}]} **

:-(

2008/1/31, Jakob Cederlund <>:
>
>  Hi,
> there is not yet a public api for this in OTP. However, the undocumented,
> unsupported function ssl_pkix:decode_rsa_keyfile/2 does just this. It reads
> a .pem keyfile and returns a record with exponent and modulus, and other
> fields. It is unsupported, so it might be moved (or even removed) in future
> releases of OTP.
> /Jakob
>
>
> Daniel Kwiecinski wrote:
>
> Hi,
>
>    As far as I know the crypto module (app) handles rsa's private keys as
> a list of two binaries (exponent and modulus). How can I obtain these from
> base64 encoded *.pem files?
>
> --
> Kind Regards,
> Daniel Kwiecinski
>
> ------------------------------
>
> _______________________________________________
> erlang-questions mailing list
> ://www.erlang.org/mailman/listinfo/erlang-questions
>
>
>


-- 
Kind Regards,
Daniel Kwiecinski

m: 0 7852745975
e:  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080131/d7f605ac/attachment.html>


More information about the erlang-questions mailing list