<div dir="ltr"><div><div>Hi all, I got lots of problems with dogtag(ekhmmm... almost 20 threads in october : ) if somebody not notice) but this is propably the last one:D<br></div><br></div>It happens if recovery needs more than one agent approval.<br><div><br>I get request accepted by admins and problem is I can retrieve private key from browser code, but if I am trying to do this in code it throws PKI Exception and creates new recovery request <br><div><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"DejaVu Sans Mono""><span style="color:rgb(128,128,128);font-style:italic">//creates new recovery request "recover"  throws:  PKIException "Unauthorized request."<br></span><span style="color:rgb(128,128,128);font-style:italic">Key recoveredX509Key = keyClient.retrieveKeyByPKCS12(keyid,cert,password);<br></span><span style="color:rgb(128,128,128);font-style:italic"><br>//creates new recovery request "securityDataRecovery" and throws: "RuntimeException com.netscape.certsrv.base.PKIException: Unauthorized request.  Recovery request not approved."<br></span>Key recoveredX509Key = <span style="color:rgb(102,14,122);font-weight:bold">keyClient</span>.retrieveKey(keyid);<br><br><br></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"DejaVu Sans Mono"">but for this same key when I open it in browser I got form to retrieve key to pk12 and it works perfectly. I check logs and it shows me where this form data goes:<br><br><span style="color:rgb(128,128,128);font-style:italic">            [01/lis/2015:13:29:04][http-bio-8443-exec-2]: CMSServlet:service() uri = /kra/agent/kra/getAsyncPk12<br></span><span style="color:rgb(128,128,128);font-style:italic">            [01/lis/2015:13:29:04][http-bio-8443-exec-2]: CMSServlet::service() param name='seqNum' value='339'<br></span><span style="color:rgb(128,128,128);font-style:italic">            [01/lis/2015:13:29:04][http-bio-8443-exec-2]: CMSServlet::service() param name='p12Password' value='(sensitive)'<br></span><span style="color:rgb(128,128,128);font-style:italic">            [01/lis/2015:13:29:04][http-bio-8443-exec-2]: CMSServlet::service() param name='p12PasswordAgain' value='(sensitive)'<br></span><span style="color:rgb(128,128,128);font-style:italic">            [01/lis/2015:13:29:04][http-bio-8443-exec-2]: CMSServlet::service() param name='op' value='getAsyncPk12'<br></span><span style="color:rgb(128,128,128);font-style:italic">            [01/lis/2015:13:29:04][http-bio-8443-exec-2]: CMSServlet::service() param name='reqID' value='339'<br><br></span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"DejaVu Sans Mono"">Anyone have idea what I'm doing wrong? Is there any way to execute getAsyncPk12 service from code? If You need more code or context, give me a note.<span style="color:rgb(128,128,128);font-style:italic"><br></span></pre></div></div></div>