Note that there are some explanatory texts on larger screens.

plurals
  1. POCertificate for TCPDF
    primarykey
    data
    text
    <p>I would like to generate a certificate(self-signed at the moment) for an encrypted PDF on the server. What is interesting to me is the workflow on how to to that with TCPDF.</p> <p><strong>What I did:</strong></p> <p>1) Generate keys:</p> <pre><code>openssl req -x509 -nodes -days 365000 -newkey rsa:1024 openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12 </code></pre> <p>2) Then generate the PDF with the <code>.crt</code> - file</p> <p>3) Then I started acrobat reader and installed the certificate (<code>tcpdf.p12</code>). I used Document->security settings -> digital id</p> <p>4) I could import the security settings but still can't open the PDF. Don't know if I am doing it right? What happens that acrobat reader 9.5.4 opens a dialog with input of a password. I give in the password and an error appears -> unknown error -> CRecipientList-218</p> <p>5) Code I used (basically the same)</p> <pre><code>$certificate = 'file://../tcpdf.crt'; $info = array( 'Name' =&gt; 'TCPDF', 'Location' =&gt; 'Office', 'Reason' =&gt; 'Testing TCPDF', 'ContactInfo' =&gt; 'http://www.tcpdf.org', ); $pdf-&gt;setSignature($certificate, $certificate, 'tcpdfdemo', '', 2, $info); $pdf-&gt;SetProtection($permissions=array('print', 'copy'), $user_pass='', owner_pass=null, $mode=1, $pubkeys=array(array('c' =&gt; 'file://../tcpdf.crt', 'p' =&gt; array('print')))); </code></pre> <p>I combined the following examples:</p> <p><a href="http://www.tcpdf.org/examples/example_052.phps" rel="nofollow noreferrer">http://www.tcpdf.org/examples/example_052.phps</a></p> <p><a href="http://www.tcpdf.org/examples/example_016.phps" rel="nofollow noreferrer">http://www.tcpdf.org/examples/example_016.phps</a></p> <p>P.S.: I know its a very practical example. Just thought its easier to understand the steps I am doing.</p> <p><strong>Questions:</strong></p> <ol> <li><p>Is the workflow in general right on how(!) to approach certificates for a PDF with encryption? </p></li> <li><p>When I generate the <code>.p12</code> file I have to give in a password for that file which I used later on when imported the certificate into acrobat. I'm asking because I have also the possibility "on generation" to give the password.</p></li> <li><p>If the workflow is right...how do I fix the problem?</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload