[xmlsec] explicitly set key in decrypt3 example failing

Kent Watsen kwatsen at juniper.net
Wed Mar 3 15:05:21 PST 2010


Hi,

I'm trying to simplify decrypt3 example by explicitly setting encCtx->encKey instead of relying on a keys mngr.  Specifically, I changed:

          encCtx = xmlSecEncCtxCreate(mngr);

To:

          encCtx = xmlSecEncCtxCreate(NULL);
            encCtx->encKey = xmlSecCryptoAppKeyLoad("rsakey.pem", xmlSecKeyDataFormatPem, NULL, NULL, NULL);


But I get errors:

func=xmlSecEncCtxEncDataNodeRead:file=xmlenc.c:line=885:obj=unknown:subj=unknown:error=45:key is not found:
func=xmlSecEncCtxDecryptToBuffer:file=xmlenc.c:line=643:obj=unknown:subj=xmlSecEncCtxEncDataNodeRead:error=1:xmlsec library function failed:
func=xmlSecEncCtxDecrypt:file=xmlenc.c:line=582:obj=unknown:subj=xmlSecEncCtxDecryptToBuffer:error=1:xmlsec library function failed:
Error: decryption failed


Should explicitly setting the key work?

Thanks,
Kent

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aleksey.com/pipermail/xmlsec/attachments/20100303/304d74d8/attachment.html>


More information about the xmlsec mailing list