[xmlsec] Problem extracting public key from X509 certificate
Aleksey Sanin
aleksey at aleksey.com
Mon Dec 15 07:36:39 PST 2008
Do you have "trusted" or "root" certificate in the xmlsec keys manager?
Aleksey
Jaume Saura wrote:
> Hello,
>
> I've an XMLDSig file which includes the signing certificate in a
> <ds:X509Certificate> tag, but xmlsec shows these error messages when I
> try to verify the signature with "xmlsec verify ..\endesa.xml":
>
> func=xmlSecKeysMngrGetKey:file=..\src\keys.c:line=1364:obj=unknown:subj=xmlSecKe
> ysMngrFindKey:error=1:xmlsec library function failed:
>
> func=xmlSecDSigCtxProcessKeyInfoNode:file=..\src\xmldsig.c:line=871:obj=unknown:
> subj=unknown:error=45:key is not found:
>
> func=xmlSecDSigCtxProcessSignatureNode:file=..\src\xmldsig.c:line=565:obj=unknow
> n:subj=xmlSecDSigCtxProcessKeyInfoNode:error=1:xmlsec library function
> failed:
>
> func=xmlSecDSigCtxVerify:file=..\src\xmldsig.c:line=366:obj=unknown:subj=xmlSecD
> SigCtxSigantureProcessNode:error=1:xmlsec library function failed:
>
> Error: signature failed
> ERROR
> SignedInfo References (ok/all): 2/2
> Manifests References (ok/all): 0/0
> Error: failed to verify file "..\endesa.xml"
>
> The signature is OK, and I can verify this if I extract manually the
> certificate and, from openssl, get its public key and then, again from
> xmlsec, retry the verification so:
>
> xmlsec verify --pubkey endesa-pkey.pem ..\endesa.xml
>
> OK
> SignedInfo References (ok/all): 2/2
> Manifests References (ok/all): 0/0
>
> This is the certificate that xmlsec doesn't handle well:
>
> <ds:X509Certificate xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
> MIII2zCCB8OgAwIBAgIQZpIEicjJWTFxpWfnQvHRDTANBgkqhkiG9w0BAQUFADCB2jELMAkGA1UE
> BhMCRVMxDzANBgNVBAgTBk1hZHJpZDE3MDUGA1UEBxMuUGFzZW8gZGVsIEdlbmVyYWwgTWFydGlu
> ZXogQ2FtcG9zIDQ2LTZhIHBsYW50YTFLMEkGA1UEChNCQWdlbmNpYSBOb3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CwgVE9N
> TyAxMjc5NywgRk9MSU8gMjA4LCBIT0pBIE0tMjA1MzgxLCBJTlNDUklQQ0lPTiAxCjAjBgorBgEE
> gZNoCgEBBBUTE0Fwb2RlcmFkbyBNZXJjYW50aWwwJQYKKwYBBIGTaAoBAgQXExVTaW4gbGltaXRl
> IGRlIGN1YW50aWEwOwYKKwYBBIGTaAoBAwQtEytOb3RhcmlvIFNBTlRJQUdPIFJVQklPIExJTklF
> UlMgLSAjMTIgLSAyMDA2MGEGCisGAQSBk2gKAQYEUxNRUkVHSVNUUk8gTUVSQ0FOVElMIERFIE1B
> RFJJRCwgVE9NTyAxMjc5NywgRk9MSU8gMjA4LCBIT0pBIE0tMjA1MzgxLCBJTlNDUklQQ0lPTiAx
> MA0GCSqGSIb3DQEBBQUAA4IBAQCrGMcH6PmCRMvWKrn/FARQkj0iSdKrzRBdSRvZf53anz5srD4y
> VTAevvd3ww93gT3zUCiKADKZszNmmIe2/ByWjdaGH6EXzyCsIGr/uKGgJuTbcD158L6GVz/1eK+k
> V5RcXPfHLYheTUKZBrAIR7mhOcjOCVZI8UJunjqYWBx0yKFC1iiuIbMicWu5UEJ3BRfC05DhJ8jf
> amTDu2vYaUKi0ig8/VjFg80h1j6WzcWKCMFNe8iT0V1+z7Dgy1Abes/MU+15Cl2Ruz9eJspWHeqm
> 9wkbVX+2tDwMVVhfxSOm3IWTWwp7avzt0gBqExOSt8xD+/jpErd1npddRMiklfbK
> </ds:X509Certificate>
>
> Do you know why xmlsec fails to recover the public key from this
> certificate? (openssl command line tool works well with it)
>
> There is some solution?
>
> ------------------------------------------------------------------------
> ¡Accede al correo desde el móvil! ¿Qué opinas?
> <http://vivelive.com/encuesta/>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> xmlsec mailing list
> xmlsec at aleksey.com
> http://www.aleksey.com/mailman/listinfo/xmlsec
More information about the xmlsec
mailing list