<div>I am still getting the same error invalid format.</div>
<div>Shoud the binary data be converted to base64 before being used?</div>
<div>The actual code reads as follows:-</div>
<div><span class="q">
<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></span>
<p> /* load public key */<br> <span class="q"><br> 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> <<a href="mailto:cyeshwanth@gmail.com">cyeshwanth@gmail.com</a>> 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 actual code reads as follows:-</div>
<div><span class="q">
<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></span>
<p> /* load public key */<br> <span class="q"><br> xmlSecCryptoAppKeyLoadMemory((const unsigned char*)memblock,size, xmlSecKeyDataFormatBinary, NULL,NULL,NULL);<br></span>Regards</p>
<p>Yesh</p><br><br> </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> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:aleksey@aleksey.com" target="_blank">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></span>
</div></blockquote></div><br>