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

Trevor Woollacott [ MTN - Innovation Centre ] Woolla_T@REDACTED
Thu Jan 31 15:51:08 CET 2008


Hi,

 

Ssl_pkix:decode_rsa_keyfile is returning undefined because it requires
two parameters, namely Key File and Password

 

Trevor

 

________________________________

From: erlang-questions-bounces@REDACTED
[mailto:erlang-questions-bounces@REDACTED] On Behalf Of Daniel
Kwiecinski
Sent: Thursday, 31 January 2008 04:12 PM
To: Jakob Cederlund
Cc: erlang-questions@REDACTED
Subject: Re: [erlang-questions] Dealing with public/private keys stored
in*.pem files

 

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 <jakob@REDACTED>:

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

erlang-questions@REDACTED
http://www.erlang.org/mailman/listinfo/erlang-questions

 




-- 
Kind Regards, 
Daniel Kwiecinski

m: 0 7852745975
e:  daniel.kwiecinski@REDACTED 

NOTE: This e-mail message is subject to the MTN Group disclaimer see http://www.mtn.co.za/default.aspx?pid=34411
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080131/37ecf5f0/attachment.htm>


More information about the erlang-questions mailing list