<div>Sorry. I have put in some commented out code as well</div>
<div>The actual code reads as follows:-</div>
<div>
<p> ifstream::pos_type size;<br> char * memblock;<br> ifstream file ("c:\\fread.txt", ios::in|ios::binary|ios::ate);</p>
<p>if (file.is_open())<br> {<br> size = file.tellg();<br> memblock = new char [size];<br> file.seekg (0, ios::beg);<br> file.read (memblock, size);<br> file.close();</p>
<p> cout << "the complete file content is in memory";</p>
<p> }<br> else cout << "Unable to open file";</p>
<p> /* load public key */<br> <br> xmlSecCryptoAppKeyLoadMemory((const unsigned char*)memblock,size, xmlSecKeyDataFormatBinary, NULL,NULL,NULL);<br>Regards</p>
<p>Yesh</p><br><br> </div>
<div><span class="gmail_quote">On 12/18/06, <b class="gmail_sendername">Aleksey Sanin</b> <<a href="mailto:aleksey@aleksey.com">aleksey@aleksey.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">> //dsigCtx->signKey = xmlSecCryptoAppKeyLoad(key_file,<br>> xmlSecKeyDataFormatPem, NULL, NULL, NULL);
<br>> xmlSecCryptoAppKeyLoadMemory((const unsigned char*)memblock,size,<br>> xmlSecKeyDataFormatBinary, NULL,NULL,NULL);<br>><br><br><br>PEM format != Binary format<br><br>Aleksey<br><br></blockquote></div><br>