[Fwd: [xmlsec] Loading PEM keys from memory instead of a file]

Meg Morgan meg@votehere.net
Fri, 24 Jan 2003 23:13:10 +0000


So obvious.  Thank you - you made my weekend!

meg

Aleksey Sanin wrote:
> 
> You need to create DSA key first and next set a value:
> 
>     DSA * dsa = NULL;
>     xmlSecKeyPtr key;
>     int ret;
> 
>     /* create DSA key */
>     dsa = .....
> 
>     /* create xmlSecKey */
>     key = xmlSecKeyCreate(xmlSecDsaKey, xmlSecKeyOriginDefault);
>     if(key == NULL) {
>         fprintf(stderr, "Error: failed to create dsa key\n");
>         return(NULL);
>     }
> 
>     /* set value */
>     ret = xmlSecDsaKeyGenerate(key, dsa);
>     if(ret < 0) {
>         xmlSecKeyDestroy(key);
>         fprintf(stderr, "Error: failed to set dsa key params\n");
>         return(NULL);
>     }
> 
> Aleksey
> 
> Meg Morgan wrote:
> 
> >Oops forgot to send it to the list too..
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > Subject:
> > Re: [xmlsec] Loading PEM keys from memory instead of a file
> > From:
> > Meg Morgan <meg@votehere.net>
> > Date:
> > Fri, 24 Jan 2003 22:02:57 +0000
> > To:
> > Aleksey Sanin <aleksey@aleksey.com>
> >
> >
> >Hmm, xmlSecDsaKeyGenerate is returning -1 for me.
> >The console says:
> >
> ><..\src\dsa.c:533>: error 100: assertion : key != NULL
> >
> >Here's the input:
> >
> >xmlSecKeyPtr key = NULL;
> >DSA * dsa = NULL;
> >char *passwd = "";
> >std::string prvkey_str;
> >int retval = 0;
> >
> >

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Meg Morgan                           425/450-2754
meg@votehere.net                   http://www.votehere.net