<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=FR link=blue vlink=purple>
<div class=WordSection1>
<p class=MsoNormal>I’m trying to use XmlSec binaries with an pkcs11
engine which work fine with openssl :<o:p></o:p></p>
<p class=MsoNormal>OpenSsl config file :<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>openssl_conf = openssl_def<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>[openssl_def]<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>engines = engine_section<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>[engine_section]<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>pkcs11 = pkcs11_section<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>[pkcs11_section]<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>engine_id = pkcs11<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>dynamic_path = ./engine_pkcs11.dll<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>MODULE_PATH = c:/windows/cps_pkcs11_w32.dll<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>init = 0<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>PIN=1234<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>[req]<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>distinguished_name =
req_distinguished_name<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>[req_distinguished_name]<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Dos command line<o:p></o:p></p>
<p class=MsoNormal>xmlsec --sign--pwd 1234 --crypto openssl --crypto-config
.\openssl.cfg TestEnvoi.txt<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>And i have this error<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>func=xmlSecKeysMngrGetKey:file=..\src\keys.c:line=1370:obj=unknown:subj=xmlSecKeysMngrFindKey:error=1:xmlsec
library function failed:<o:p></o:p></p>
<p class=MsoNormal>func=xmlSecDSigCtxProcessKeyInfoNode:file=..\src\xmldsig.c:line=871:obj=unknown:subj=unknown:error=45:key
is not found:<o:p></o:p></p>
<p class=MsoNormal>func=xmlSecDSigCtxProcessSignatureNode:file=..\src\xmldsig.c:line=565:obj=unknown:subj=xmlSecDSigCtxProcessKeyInfoNode:error=1:xmlsec
library function failed:<o:p></o:p></p>
<p class=MsoNormal>func=xmlSecDSigCtxSign:file=..\src\xmldsig.c:line=303:obj=unknown:subj=xmlSecDSigCtxSigantureProcessNode:error=1:xmlsec
library function failed:<o:p></o:p></p>
<p class=MsoNormal>Error: signature failed<o:p></o:p></p>
<p class=MsoNormal>Error: failed to sign file "TestEnvoi.txt"<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>With a pem certificate, the file can be signed.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>So, the problem is with openssl and the config file or the engine
i’m using.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Does xmlSec work with pkcs11 engine without change ?
Because I saw some patch but can’t find them with problem on private key.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Thanks for help.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>-----------------------------------------------</span><br>
<span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Denis GOUSSEAU</span><br>
<span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Société
SANTEOS</span><br>
<span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>-----------------------------------------------</span><o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>