[xmlsec] xmlSecCryptoAppKeyLoadMemory
Yeshwanth C
cyeshwanth at gmail.com
Sun Dec 17 22:50:43 PST 2006
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 <cyeshwanth at gmail.com> 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 <cyeshwanth at gmail.com> 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 <aleksey at aleksey.com > 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
> > >
> > >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.aleksey.com/pipermail/xmlsec/attachments/20061218/5daa89b7/attachment-0002.htm
More information about the xmlsec
mailing list