There is no such function <font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">'decode_rsa_keyfile' </span></font>at all in '<font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">ssl_pkix' module in erts v5.5.5<br>
<br><span style="font-family: courier new,monospace;">Eshell V5.5.5 (abort with ^G)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">1> m(ssl_pkix).</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Module ssl_pkix compiled: Date: June 11 2007, Time: 17.57</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Compiler options: [{d,'VSN',"<a href="http://3.1.1.1">3.1.1.1</a>"},</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> {cwd,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/ssl/src"},</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> {outdir,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/ssl/src/../ebin"},</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> {i,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/kernel/src"},</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> {i,"/ldisk/daily_build/otp_prebuild_r11b.2007-06-11_19/otp_src_R11B-5/lib/ssl/src/../include"},</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> warn_unused_vars,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> debug_info]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Object file: /sw/lib/erlang/lib/ssl-<a href="http://3.1.1.1/ebin/ssl_pkix.beam">3.1.1.1/ebin/ssl_pkix.beam</a></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Exports: </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> decode_cert/1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> decode_cert/2</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> decode_cert_file/1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> decode_cert_file/2</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> module_info/0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> module_info/1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">ok</span><br><br></span></font><font size="6">:-( <font size="2">Daniel</font><br><br></font><div><span class="gmail_quote">2008/1/31, Trevor Woollacott [ MTN - Innovation Centre ] <<a href="mailto:Woolla_T@mtn.co.za">Woolla_T@mtn.co.za</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="blue" lang="EN-US">
<div>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Hi,</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Ssl_pkix:decode_rsa_keyfile is returning
undefined because it requires two parameters, namely Key File and Password</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Trevor</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<div>
<div style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">
<hr align="center" size="2" width="100%">
</span></font></div>
<p><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">
<a href="mailto:erlang-questions-bounces@erlang.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">erlang-questions-bounces@erlang.org</a> [mailto:<a href="mailto:erlang-questions-bounces@erlang.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">erlang-questions-bounces@erlang.org</a>]
<b><span style="font-weight: bold;">On Behalf Of </span></b>Daniel Kwiecinski<br>
<b><span style="font-weight: bold;">Sent:</span></b> Thursday, 31 January 2008
04:12 PM<br>
<b><span style="font-weight: bold;">To:</span></b> Jakob Cederlund<br>
<b><span style="font-weight: bold;">Cc:</span></b> <a href="mailto:erlang-questions@erlang.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">erlang-questions@erlang.org</a><br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [erlang-questions]
Dealing with public/private keys stored in*.pem files</span></font></p>
</div><div><span class="e" id="q_117d05768f2377d2_1">
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
<p style="margin-bottom: 12pt;"><font face="Courier New" size="3"><span style="font-size: 12pt;">Eshell V5.5.5 (abort
with ^G)<br>
1> ssl_pkix:decode_rsa_keyfile("public.pem").<br>
** exited: {undef,[{ssl_pkix,decode_rsa_keyfile,["public.pem"]},<br>
{erl_eval,do_apply,5},<br>
{shell,exprs,6},<br>
{shell,eval_loop,3}]} **<br>
<br>
=ERROR REPORT==== 31-Jan-2008::14:11:10 ===<br>
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}]}<br>
<br>
2> ssl_pkix:decode_cert_file("public.pem", [pem]).<br>
<br>
=ERROR REPORT==== 31-Jan-2008::14:11:22 ===<br>
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}]}<br>
<br>
** exited: {{badmatch,{ok,[]}},<br>
[{ssl_pkix,decode_cert_file,2},<br>
{erl_eval,do_apply,5},<br>
{shell,exprs,6},<br>
{shell,eval_loop,3}]} **</span></font><br>
<br>
<font size="6"><span style="font-size: 24pt;">:-(</span></font></p>
<div>
<p><span><font face="Times New Roman" size="3"><span style="font-size: 12pt;">2008/1/31, Jakob Cederlund <<a href="mailto:jakob@erix.ericsson.se" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jakob@erix.ericsson.se</a>>:</span></font></span></p>
<div bgcolor="#ffffff" text="#000000">
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Hi,<br>
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.<br>
/Jakob<br>
<br>
<br>
Daniel Kwiecinski wrote: </span></font></p>
<div><span>
<p><span><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Hi,</span></font></span><br>
<br>
<span> As far as I know the crypto module (app) handles <a name="117d05768f2377d2_117d015bb020629b_rsa_verify/3">rsa's </a>private keys as a list of two
binaries (exponent and modulus). How can I obtain these from base64 encoded
*.pem files?</span><br clear="all">
<br>
<span>-- </span><br>
<span>Kind Regards, </span><br>
<span>Daniel Kwiecinski</span><br>
<br>
<br>
</p>
</span></div>
<pre style="text-align: center;"><font face="Courier New" size="2"><span style="font-size: 10pt;">
<hr align="center" size="4" width="90%">
</span></font></pre><pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> </span></font></pre><pre><font face="Courier New" size="2"><span style="font-size: 10pt;">_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">erlang-questions@erlang.org</a></span></font></pre><pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.erlang.org/mailman/listinfo/erlang-questions</a></span></font></pre>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
</div>
</div>
</span></div>
</div>
NOTE: This e-mail message is subject to the MTN Group disclaimer see <a href="http://www.mtn.co.za/default.aspx?pid=34411" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.mtn.co.za/default.aspx?pid=34411</a></div>
</blockquote></div><br><br clear="all"><br>