java pdf 签名 修改,使用Java中的自定义数字签名来签名PDF

I've created a digital signature using Sun's code:http://download.oracle.com/javase/tutorial/security/apisign/examples/GenSig.java. How can I sign a pdf file using this digital signature? That is: how can I add the signature to a pdf file?

解决方案

You've taken the wrong approach. You can't easily append the signature to the PDF. PDF specification includes support for digital signatures. Those signatures are embedded into the document, and their calculation is a non-trivial process.

Your best bet is to drop your current implementation and take eg. iText library or our SecureBlackbox which will do the job for you.

If your task is to implement signature yourself, then take PDF specification, read it and implement the corresponding pieces of it (and in this case your question is way too broad to be answered in StackOverflow format).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值