Discussion:
[xmlsec] Problem signing xml
Balamurali Pandranki
2017-10-14 13:02:22 UTC
Permalink
Command :

xmlsec1 --sign --pkcs12 Staging_Signature_PrivateKey.p12 --pwd public --output /Users/itsbalamurali/Workspace/out.xml /Users/itsbalamurali/Workspace/in.xml

XMLSEC1 VERSION: xmlsec1 1.2.20 (openssl)

XML trying to sign:

<?xml version='1.0' encoding='UTF-8'?>
<Otp uid="999999990019" type="A" tid="public" lk="MEaMX8fkRa6PqsqK6wGMrEXcXFl_oXHA-YuknI2uf0gKgZ80HaZgG3A" ver="1.6" txn="WieW8ZTFp0" ac="public" sa="public">
<Opts ch="00"></Opts>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<CanonicalizationMethod xmlns="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod>
<SignatureMethod xmlns="http://www.w3.org/2000/09/xmldsig#" Algorithm=""></SignatureMethod>
<Reference xmlns="http://www.w3.org/2000/09/xmldsig#">
<Transforms xmlns="http://www.w3.org/2000/09/xmldsig#">
<Transform xmlns="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
<Transform xmlns="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
</Transforms>
<DigestMethod xmlns="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
<DigestValue xmlns="http://www.w3.org/2000/09/xmldsig#"></DigestValue>
</Reference>
</SignedInfo>
<SignatureValue xmlns="http://www.w3.org/2000/09/xmldsig#"></SignatureValue>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<X509Data xmlns="http://www.w3.org/2000/09/xmldsig#">
<X509Certificate xmlns="http://www.w3.org/2000/09/xmldsig#"></X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
</Otp>

Error:

func=xmlSecTransformNodeRead:file=transforms.c:line=1543:obj=unknown:subj=xmlSecTransformIdListFindByHref:error=1:xmlsec library function failed:href=
func=xmlSecTransformCtxNodeRead:file=transforms.c:line=694:obj=unknown:subj=xmlSecTransformNodeRead:error=1:xmlsec library function failed:name=SignatureMethod
func=xmlSecDSigCtxProcessSignedInfoNode:file=xmldsig.c:line=742:obj=unknown:subj=xmlSecTransformCtxNodeRead:error=1:xmlsec library function failed:node=SignatureMethod
func=xmlSecDSigCtxProcessSignatureNode:file=xmldsig.c:line=547:obj=unknown:subj=xmlSecDSigCtxProcessSignedInfoNode:error=1:xmlsec library function failed:
func=xmlSecDSigCtxSign:file=xmldsig.c:line=303:obj=unknown:subj=xmlSecDSigCtxSignatureProcessNode:error=1:xmlsec library function failed:
Error: signature failed


Thanks,
Balamurali Pandranki,
Phone: +91-9908640059,
Work: ***@labwire.tech.
Aleksey Sanin
2017-10-14 21:27:23 UTC
Permalink
You have a problem in the SignatureNode definition as indicated by the
error message.

Aleksey

On 10/14/17 6:02 AM, Balamurali Pandranki wrote:
>
> Command : 
>
> xmlsec1 --sign --pkcs12 Staging_Signature_PrivateKey.p12 --pwd public
> --output /Users/itsbalamurali/Workspace/out.xml
> /Users/itsbalamurali/Workspace/in.xml
>
> XMLSEC1 VERSION: xmlsec1 1.2.20 (openssl)
>
> XML trying to sign:
>
> <?xmlversion='1.0'encoding='UTF-8'?>
> <Otpuid="999999990019"type="A"tid="public"lk="MEaMX8fkRa6PqsqK6wGMrEXcXFl_oXHA-YuknI2uf0gKgZ80HaZgG3A"ver="1.6"txn="WieW8ZTFp0"ac="public"sa="public">
> <Optsch="00"></Opts>
> <Signaturexmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfoxmlns="http://www.w3.org/2000/09/xmldsig#">
> <CanonicalizationMethodxmlns="http://www.w3.org/2000/09/xmldsig#"Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod>
> <SignatureMethodxmlns="http://www.w3.org/2000/09/xmldsig#"Algorithm=""></SignatureMethod>
> <Referencexmlns="http://www.w3.org/2000/09/xmldsig#">
> <Transformsxmlns="http://www.w3.org/2000/09/xmldsig#">
> <Transformxmlns="http://www.w3.org/2000/09/xmldsig#"Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
> <Transformxmlns="http://www.w3.org/2000/09/xmldsig#"Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
> </Transforms>
> <DigestMethodxmlns="http://www.w3.org/2000/09/xmldsig#"Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> <DigestValuexmlns="http://www.w3.org/2000/09/xmldsig#"></DigestValue>
> </Reference>
> </SignedInfo>
> <SignatureValuexmlns="http://www.w3.org/2000/09/xmldsig#"></SignatureValue>
> <KeyInfoxmlns="http://www.w3.org/2000/09/xmldsig#">
> <X509Dataxmlns="http://www.w3.org/2000/09/xmldsig#">
> <X509Certificatexmlns="http://www.w3.org/2000/09/xmldsig#"></X509Certificate>
> </X509Data>
> </KeyInfo>
> </Signature>
> </Otp>
>
> Error:
>
> func=xmlSecTransformNodeRead:file=transforms.c:line=1543:obj=unknown:subj=xmlSecTransformIdListFindByHref:error=1:xmlsec
> library function failed:href=
> func=xmlSecTransformCtxNodeRead:file=transforms.c:line=694:obj=unknown:subj=xmlSecTransformNodeRead:error=1:xmlsec
> library function failed:name=SignatureMethod
> func=xmlSecDSigCtxProcessSignedInfoNode:file=xmldsig.c:line=742:obj=unknown:subj=xmlSecTransformCtxNodeRead:error=1:xmlsec
> library function failed:node=SignatureMethod
> func=xmlSecDSigCtxProcessSignatureNode:file=xmldsig.c:line=547:obj=unknown:subj=xmlSecDSigCtxProcessSignedInfoNode:error=1:xmlsec
> library function failed:
> func=xmlSecDSigCtxSign:file=xmldsig.c:line=303:obj=unknown:subj=xmlSecDSigCtxSignatureProcessNode:error=1:xmlsec
> library function failed:
> Error: signature failed
>
>
> Thanks,
> *Balamurali Pandranki,*
> Phone: +91-9908640059,
> Work: ***@labwire.tech.
>
>
> _______________________________________________
> xmlsec mailing list
> ***@aleksey.com
> http://www.aleksey.com/mailman/listinfo/xmlsec
>
Balamurali Pandranki
2017-10-16 00:27:27 UTC
Permalink
Thank you,

Solved it.

Best,
Balamurali Pandranki,
+91-990-864-0059,
P.S I am mobile.

________________________________
From: Aleksey Sanin <***@aleksey.com>
Sent: Sunday, October 15, 2017 2:57:23 AM
To: Balamurali Pandranki; ***@aleksey.com
Subject: Re: [xmlsec] Problem signing xml

You have a problem in the SignatureNode definition as indicated by the
error message.

Aleksey

On 10/14/17 6:02 AM, Balamurali Pandranki wrote:
>
> Command :
>
> xmlsec1 --sign --pkcs12 Staging_Signature_PrivateKey.p12 --pwd public
> --output /Users/itsbalamurali/Workspace/out.xml
> /Users/itsbalamurali/Workspace/in.xml
>
> XMLSEC1 VERSION: xmlsec1 1.2.20 (openssl)
>
> XML trying to sign:
>
> <?xmlversion='1.0'encoding='UTF-8'?>
> <Otpuid="999999990019"type="A"tid="public"lk="MEaMX8fkRa6PqsqK6wGMrEXcXFl_oXHA-YuknI2uf0gKgZ80HaZgG3A"ver="1.6"txn="WieW8ZTFp0"ac="public"sa="public">
> <Optsch="00"></Opts>
> <Signaturexmlns="http://www.w3.org/2000/09/xmldsig#">
> <SignedInfoxmlns="http://www.w3.org/2000/09/xmldsig#">
> <CanonicalizationMethodxmlns="http://www.w3.org/2000/09/xmldsig#"Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"></CanonicalizationMethod>
> <SignatureMethodxmlns="http://www.w3.org/2000/09/xmldsig#"Algorithm=""></SignatureMethod>
> <Referencexmlns="http://www.w3.org/2000/09/xmldsig#">
> <Transformsxmlns="http://www.w3.org/2000/09/xmldsig#">
> <Transformxmlns="http://www.w3.org/2000/09/xmldsig#"Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></Transform>
> <Transformxmlns="http://www.w3.org/2000/09/xmldsig#"Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
> </Transforms>
> <DigestMethodxmlns="http://www.w3.org/2000/09/xmldsig#"Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
> <DigestValuexmlns="http://www.w3.org/2000/09/xmldsig#"></DigestValue>
> </Reference>
> </SignedInfo>
> <SignatureValuexmlns="http://www.w3.org/2000/09/xmldsig#"></SignatureValue>
> <KeyInfoxmlns="http://www.w3.org/2000/09/xmldsig#">
> <X509Dataxmlns="http://www.w3.org/2000/09/xmldsig#">
> <X509Certificatexmlns="http://www.w3.org/2000/09/xmldsig#"></X509Certificate>
> </X509Data>
> </KeyInfo>
> </Signature>
> </Otp>
>
> Error:
>
> func=xmlSecTransformNodeRead:file=transforms.c:line=1543:obj=unknown:subj=xmlSecTransformIdListFindByHref:error=1:xmlsec
> library function failed:href=
> func=xmlSecTransformCtxNodeRead:file=transforms.c:line=694:obj=unknown:subj=xmlSecTransformNodeRead:error=1:xmlsec
> library function failed:name=SignatureMethod
> func=xmlSecDSigCtxProcessSignedInfoNode:file=xmldsig.c:line=742:obj=unknown:subj=xmlSecTransformCtxNodeRead:error=1:xmlsec
> library function failed:node=SignatureMethod
> func=xmlSecDSigCtxProcessSignatureNode:file=xmldsig.c:line=547:obj=unknown:subj=xmlSecDSigCtxProcessSignedInfoNode:error=1:xmlsec
> library function failed:
> func=xmlSecDSigCtxSign:file=xmldsig.c:line=303:obj=unknown:subj=xmlSecDSigCtxSignatureProcessNode:error=1:xmlsec
> library function failed:
> Error: signature failed
>
>
> Thanks,
> *Balamurali Pandranki,*
> Phone: +91-9908640059,
> Work: ***@labwire.tech.
>
>
> _______________________________________________
> xmlsec mailing list
> ***@aleksey.com
> http://www.aleksey.com/mailman/listinfo/xmlsec
>
Loading...