I am trying the following  code that gives me the error invalid format:-

ifstream::pos_type size;
 char * memblock;


ifstream file ("c:\\fread.txt", ios::in|ios::binary|ios::ate);

if (file.is_open())
{
 size = file.tellg();
 memblock = new  char [size];
 file.seekg (0, ios::beg);
 file.read (memblock, size);
 file.close();

 cout << "the complete file content is in memory";

}
else cout << "Unable to open file";

   /* load public key */
   //dsigCtx->signKey = xmlSecCryptoAppKeyLoad(key_file,
xmlSecKeyDataFormatPem, NULL, NULL, NULL);
xmlSecCryptoAppKeyLoadMemory((const unsigned char*)memblock,size,
xmlSecKeyDataFormatBinary, NULL,NULL,NULL);
....

Please Advise
regards
yesh

On 12/15/06, Aleksey Sanin <[EMAIL PROTECTED]> wrote:

Again, you must have in the right format as specified by the "format"
parameter.

Aleksey

Yeshwanth C wrote:
> I am reading a public key stored in binary format which I got from a key
> blob with the function
> xmlSecCryptoAppKeyLoadMemory().  But I am getting the error "Invalid
format"
> Kindly advise
> Thanks in advance
> yesh
>
> On 12/15/06, *Aleksey Sanin* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>     If you can get key in the required binary format, then "yes".
>     xmlSecCryptoAppKeyLoadMemory() reads key in given format from
>     a memory block. Very similar to file based version.
>
>     Aleksey
>
>     Yeshwanth C wrote:
>      > Can I send the key that is returned as an argument to
>      > xmlSecCryptoAppKeyLoadMemory() ?
>      >
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> xmlsec mailing list
> [email protected]
> http://www.aleksey.com/mailman/listinfo/xmlsec

_______________________________________________
xmlsec mailing list
[email protected]
http://www.aleksey.com/mailman/listinfo/xmlsec

Reply via email to