数字签名
数字签名
iSignature_PDF_API中间件产品是一款跨平台的PDF中间件产品,以下是针对文档实现数字签名的功能实现。
调用示例
public void digitalSignatures(){ KGPdfHummer hummer = null; FileInputStream cert = null; FileOutputStream fileOutputStream = null; try { cert = new FileInputStream("D:/tmp/sign.pfx"); fileOutputStream = new FileOutputStream("D:/tmp/2.pdf"); hummer = KGPdfHummer.createSignature("D:/tmp/1.pdf", null, true, fileOutputStream, new File("D:/tmp/"),true); hummer.setCertificate(cert, "123456", "123456"); PdfSignature4KG pdfSignature4KG = new PdfSignature4KG( "d:/tmp/iSignature.key",1,"123456"); pdfSignature4KG.setText("金格科技"); hummer.setPdfSignature(pdfSignature4KG); hummer.doSignature(); } catch (Exception e) { e.printStackTrace(); } finally { close(cert); close(fileOutputStream); if(hummer != null) hummer.close(); } }