<div>I even converted the file to base 64 but still the same error &quot;invalid format&quot; 1.&nbsp; What should teh file format be?</div>
<div>Pasted here is the file contents</div>
<p>MIGJAoGBAM9oqhVJrRkG4Dbc1nLhpNWH1X4+U45ktc+kZD6H6gG+F/LmqA2YEZgCKJqWzjLG8MV4</p>
<p>y/8r0XDmOfCc/6i75a/h2zFphu5fakl7hZ/OshDLHgfvkr4tiIqj8JE5E6WZzFCRq4beLzrsdgG/</p>
<p>FEeP6PWoCdqHVzHCAX8c7h10QvqFAgMBAAE</p>
<p>&nbsp;</p>
<div>REgards</div>
<div>yesh</div>
<div><br><br>&nbsp;</div>
<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>I am still getting the same error invalid format.</div>
<div>Shoud the binary data&nbsp;be converted to base64 before being used?</div><span class="q">
<div>The&nbsp;actual code reads as follows:-</div>
<div><span>
<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><br>&nbsp;xmlSecCryptoAppKeyLoadMemory((const unsigned char*)memblock,size, xmlSecKeyDataFormatBinary, NULL,NULL,NULL);<br></span>Regards</p>
<p>Yesh</p></div><br><br></span>
<div><span class="e" id="q_10f9411ea38de132_2">
<div><span class="gmail_quote">On 12/18/06, <b class="gmail_sendername">Yeshwanth C</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:cyeshwanth@gmail.com" target="_blank">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>
<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><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>
<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></span></div></blockquote></div><br>