加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

如何在Ruby中对PDF文档进行数字签名?

发布时间:2020-12-17 02:42:26 所属栏目:百科 来源:网络整理
导读:是否有本地库可以对PDF文档进行数字签名? 解决方法 包 here似乎提供了使用Ruby签名PDF的扩展.它不是免费的,但看起来它提供了原生的ruby界面. 以下是如何在ruby中使用(在安装之后): require 'mypdfsigner'include MyPDFSignerinputPath = "/tmp/input.pdf"o
是否有本地库可以对PDF文档进行数字签名?

解决方法

包 here似乎提供了使用Ruby签名PDF的扩展.它不是免费的,但看起来它提供了原生的ruby界面.

以下是如何在ruby中使用(在安装之后):

require 'mypdfsigner'
include MyPDFSigner

inputPath = "/tmp/input.pdf"
outputPath = "/tmp/output.pdf"
location = "Chicago"
reason = "Demo"
contactInfo = "+1 555-555-5555"
certify = false   # not supported yet
visible = true
title = "Signing with MyPDFSigner"
author = "KryptoKoder"
subject = "Ruby Extension"
keywords = "PKCS#12,MyPDFSigner,PDF"
confFile = ""   # defaults to /usr/local/mypdfsigner/mypdfsigner.conf if empty
timestamp = true

puts mypdfsigner_sign(inputPath,outputPath,location,reason,contactInfo,certify,visible,title,author,subject,keywords,confFile,timestamp)

还有一个命令行界面,因此您可以根据需要编写脚本,以及桌面应用程序.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读