我是 PKI 的新手,希望有人能帮助我解决我的情况。我目前正在使用 Laravel 5.6 来开发我的网站,并且我正在使用该elibyy/tcpdf-laravel
包来创建 PDF。目前,当我的用户创建 PDF 时,它通过 AES 256 加密并受密码保护,但我想添加公钥加密。
这是过程,通过 HTML 创建合同,用户签署合同,签署后会出现一个复选框和一个完成按钮。他们选中该框并单击完成。然后将网页转换为 PDF 并存储在 AWS S3 上。
以下是关于公钥加密的 TCPDF 文档:
Possible encryption modes are:
0 = RSA 40 bit
1 = RSA 128 bit
2 = AES 128 bit
3 = AES 256 bit
NOTES:
- To create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt
- To export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12
- To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes
*/
$pdf->SetProtection(array('print', 'copy'), '', null, 0, null);
// Example with public-key
// To open the document you need to install the private key (tcpdf.p12) on the Acrobat Reader. The password is: 1234
//$pdf->SetProtection($permissions=array('print', 'copy'), $user_pass='', $owner_pass=null, $mode=1, $pubkeys=array(array('c' => 'file://../config/cert/tcpdf.crt', 'p' => array('print'))));
// *********************************************************
问题一:我在哪里存储公钥和私钥?在我的 Laravel 应用程序中?在 AWS S3 上?
问题二:我需要为每个合约生成一个公钥吗?
问题三:它说要打开一个文档,您必须在 Acrobat Reader 上安装私钥,我认为这是用户打开 PDF 必须做的事情?
我希望有一个关于这个的教程,但我似乎找不到。任何帮助是极大的赞赏。谢谢!