I even converted the file to base 64 but still the same error "invalid
format" 1. What should teh file format be?
Pasted here is the file contents
MIGJAoGBAM9oqhVJrRkG4Dbc1nLhpNWH1X4+U45ktc+kZD6H6gG+F/LmqA2YEZgCKJqWzjLG8MV4
y/8r0XDmOfCc/6i75a/h2zFphu5fakl7hZ/OshDLHgfvkr4tiIqj8JE5E6WZzFCRq4beLzrsdgG/
FEeP6PWoCdqHVzHCAX8c7h10QvqFAgMBAAE
REgards
yesh
On 12/18/06, Yeshwanth C <[EMAIL PROTECTED]> wrote:
I am still getting the same error invalid format.
Shoud the binary data be converted to base64 before being used?
The actual code reads as follows:-
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 */
xmlSecCryptoAppKeyLoadMemory((const unsigned char*)memblock,size,
xmlSecKeyDataFormatBinary, NULL,NULL,NULL);
Regards
Yesh
On 12/18/06, Yeshwanth C <[EMAIL PROTECTED]> wrote:
>
> Sorry. I have put in some commented out code as well
> The actual code reads as follows:-
>
> 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 */
>
> xmlSecCryptoAppKeyLoadMemory((const unsigned char*)memblock,size,
> xmlSecKeyDataFormatBinary, NULL,NULL,NULL);
> Regards
>
> Yesh
>
>
>
> On 12/18/06, Aleksey Sanin <[EMAIL PROTECTED] > wrote:
> >
> > > //dsigCtx->signKey = xmlSecCryptoAppKeyLoad(key_file,
> > > xmlSecKeyDataFormatPem, NULL, NULL, NULL);
> > > xmlSecCryptoAppKeyLoadMemory((const unsigned char*)memblock,size,
> > > xmlSecKeyDataFormatBinary, NULL,NULL,NULL);
> > >
> >
> >
> > PEM format != Binary format
> >
> > Aleksey
> >
> >
>
_______________________________________________
xmlsec mailing list
[email protected]
http://www.aleksey.com/mailman/listinfo/xmlsec