使用纯 JavaScript 签署 PDF [英] Sign PDF with plain JavaScript

查看:46
本文介绍了使用纯 JavaScript 签署 PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着 WebCrypto API 的发展和 Chrome 和 Firefox 的支持,我想用它来对 PDF 文档进行数字签名.周围的文献并不多,但我找到了一些示例 [1] 和一个名为 PKI.js [2] 的库.在示例中,描述了签名过程,但最终返回了签名.我希望我的 Base64 PDF 文件以已签名的 Base64 字符串再次返回,但遗憾的是,事实并非如此.据我所知,PKI.js 也不提供对我的 Base64 PDF 进行签名的方法.

With WebCrypto API evolving and being supported by Chrome and Firefox, I would like to use it for digitally signing a PDF document. There is not much of literature around, but I found some examples [1] and a library called PKI.js [2]. In the examples, the signing process is described, but in the end, a signature is returned. I would expect my Base64 PDF file returned again in a signed Base64 string, but sadly, this is not what happens. PKI.js too, to my knowledge, does not provide a way to sign my Base64 PDF.

是否可以仅使用 JavaScript 和 WebCrypto API 对 PDF 进行签名?私钥可以输入到