I have the following setup,
Nowadays I just sign PDF files with PKCS#12 at server side.
In my PHP webpage when I need to sign some PDF I developed a JAVA JAR application with iText.
So I just call this java app from PHP using exec function. This java will receive a PDF file as input, so it will sign with de PKCS#12 and create an output_file signed.
exec("java -jar /path_to_java_app/MySigner.jar ‘INPUT_FILE.pdf’ ‘OUTPUT_SIGNED_FILE.pdf’ ");
But now I need to sign using PKCS#11 - token usb at the client side.
How can i do this? Any sample code woukd be appreciated.