<div>I am still getting the same error invalid format.</div>
<div>Shoud the binary data&nbsp;be converted to base64 before being used?</div>
<div>The&nbsp;actual code reads as follows:-</div>
<div><span class="q">
<p>&nbsp;ifstream::pos_type size;<br>&nbsp; char * memblock;<br>&nbsp;ifstream file (&quot;c:\\fread.txt&quot;, ios::in|ios::binary|ios::ate);</p>
<p>if (file.is_open())<br>&nbsp;{<br>&nbsp;&nbsp;size = file.tellg();<br>&nbsp;&nbsp;memblock = new&nbsp; char [size];<br>&nbsp;&nbsp;file.seekg (0, ios::beg);<br>&nbsp;&nbsp;file.read (memblock, size);<br>&nbsp;&nbsp;file.close();</p>
<p>&nbsp;&nbsp;cout &lt;&lt; &quot;the complete file content is in memory&quot;;</p>
<p>&nbsp;}<br>&nbsp;else cout &lt;&lt; &quot;Unable to open file&quot;;</p></span>
<p>&nbsp;&nbsp;&nbsp; /* load public key */<br>&nbsp;&nbsp;&nbsp;<span class="q"><br>&nbsp;xmlSecCryptoAppKeyLoadMemory((const unsigned char*)memblock,size, xmlSecKeyDataFormatBinary, NULL,NULL,NULL);<br></span>Regards</p>
<p>Yesh</p></div><br><br>
<div><span class="gmail_quote">On 12/18/06, <b class="gmail_sendername">Yeshwanth C</b> &lt;<a href="mailto:cyeshwanth@gmail.com">cyeshwanth@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Sorry. I have put in some commented out code as well</div>
<div>The&nbsp;actual code reads as follows:-</div>
<div><span class="q">
<p>&nbsp;ifstream::pos_type size;<br>&nbsp; char * memblock;<br>&nbsp;ifstream file (&quot;c:\\fread.txt&quot;, ios::in|ios::binary|ios::ate);</p>
<p>if (file.is_open())<br>&nbsp;{<br>&nbsp;&nbsp;size = file.tellg();<br>&nbsp;&nbsp;memblock = new&nbsp; char [size];<br>&nbsp;&nbsp;file.seekg (0, ios::beg);<br>&nbsp;&nbsp;file.read (memblock, size);<br>&nbsp;&nbsp;file.close();</p>
<p>&nbsp;&nbsp;cout &lt;&lt; &quot;the complete file content is in memory&quot;;</p>
<p>&nbsp;}<br>&nbsp;else cout &lt;&lt; &quot;Unable to open file&quot;;</p></span>
<p>&nbsp;&nbsp;&nbsp; /* load public key */<br>&nbsp;&nbsp;&nbsp;<span class="q"><br>&nbsp;xmlSecCryptoAppKeyLoadMemory((const unsigned char*)memblock,size, xmlSecKeyDataFormatBinary, NULL,NULL,NULL);<br></span>Regards</p>
<p>Yesh</p><br><br>&nbsp;</div>
<div><span class="e" id="q_10f93fb72c847906_5">
<div><span class="gmail_quote">On 12/18/06, <b class="gmail_sendername">Aleksey Sanin</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:aleksey@aleksey.com" target="_blank">aleksey@aleksey.com
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">&gt;&nbsp;&nbsp;&nbsp;&nbsp; //dsigCtx-&gt;signKey = xmlSecCryptoAppKeyLoad(key_file,<br>&gt; xmlSecKeyDataFormatPem, NULL, NULL, NULL); 
<br>&gt;&nbsp;&nbsp;xmlSecCryptoAppKeyLoadMemory((const unsigned char*)memblock,size,<br>&gt; xmlSecKeyDataFormatBinary, NULL,NULL,NULL);<br>&gt;<br><br><br>PEM format != Binary format<br><br>Aleksey<br><br></blockquote></div><br></span>
</div></blockquote></div><br>