<div>Sorry. I have put in some commented out code as well</div>
<div>The&nbsp;actual code reads as follows:-</div>
<div>
<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>
<p>&nbsp;&nbsp;&nbsp; /* load public key */<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;xmlSecCryptoAppKeyLoadMemory((const unsigned char*)memblock,size, xmlSecKeyDataFormatBinary, NULL,NULL,NULL);<br>Regards</p>
<p>Yesh</p><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 12/18/06, <b class="gmail_sendername">Aleksey Sanin</b> &lt;<a href="mailto:aleksey@aleksey.com">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>