[xmlsec] xmlsec1+ws-security

Aleksey Sanin aleksey at aleksey.com
Thu May 6 19:24:02 PDT 2010


1) Please use xmlsec mailing list for questions about the library.

2) Did you try to verify the signed data with xmlsec command line
utility? If "not" then could you please try it?

Thanks,
Aleksey

On 5/6/2010 6:27 AM, "Székvölgyi Péter" wrote:
> Dear Aleksey,
>
> I want to use xmlsec and curl to send signed data to wss4j server with
> ws-security. But always sent to me this error:
> org.apache.ws.security.WSSecurityException: The signature or decryption
> was invalid
>
> First I created the sign node:
>
> xmlNodePtr signNode = xmlSecTmplSignatureCreateNsPref(m_doc,
> xmlSecTransformExclC14NId, xmlSecTransformRsaSha1Id, NULL, (const
> xmlChar*)"ds");
>
> xmlAddChild(Security, signNode);
>
> Add I added BinarySecurityToken with Content to Security node, then run:
>
> // I added reference and transform to:
> xmlNodePtr refnode = xmlSecTmplSignatureAddReference(signNode,
> xmlSecTransformSha1Id, NULL, (const xmlChar*)"#X509Token", NULL);
> xmlSecTmplReferenceAddTransform(refNode, xmlSecTransformExclC14NId);
>
> xmlSecTmplSignatureAddReference(signNode, xmlSecTransformSha1Id, NULL,
> (const xmlChar*)"#Body", NULL);
> xmlSecTmplReferenceAddTransform(refNode, xmlSecTransformExclC14NId);
>
> keyInfoNode = xmlSecTmplSignatureEnsureKeyInfo(signNode, NULL);
>
> Add SecurityTokenReference.
>
> dsigCtx = xmlSecDSigCtxCreate(NULL);
>
> loading cert...
>
> xmlSecDSigCtxSign(dsigCtx, signNode);
>
> The signed xml generater without any error.
>
> I tested it all of canonical method, nothing changed. Unfortunatly i don't
> have access to the server application to debug client code.
>
> Do you have any idea wath is wrong?
>
> Thanks in advance:
> Peter
>
>
>
>


More information about the xmlsec mailing list