Itext学习资料整理
无    2018-06-05 09:12:48    885    0    0
xianglijiaxing


 

 

一。证书和密钥库

 

证书使用ASN.1(Abstract Syntax Notation One)结构进行编码

https://wenku.baidu.com/view/17253f484a7302768f993912.html

http://www.asnlab.cn/asnjc/gettingstarted.html

 

PKI(Public Key Infrastructure)公钥基础设施           https://baike.baidu.com/item/PKI

证书的生成管理

CRL(Certificate Revocation List)证书吊销列表

 

X.509标准

https://blog.csdn.net/blue0bird/article/details/78656536#1-1-structure-of-a-certificate

 

x509 p12等数字证书格式区别

https://blog.csdn.net/bytxl/article/details/8586830

 https://blog.csdn.net/liaomin416100569/article/details/76020675

 

1.证书的编码格式


 

PEM就是把DER的内容进行了一次base64编码

EDR

 


2扩展名

.crt 证书文件 ,可以是DER(二进制)编码的,也可以是PEM( ASCII (Base64) )编码的 ,在类unix系统中比较常见 
.cer 也是证书  常见于Windows系统  编码类型同样可以是DER或者PEM的,windows 下有工具可以转换crt到cer
.csr 证书签名请求   一般是生成请求以后发送给CA,然后CA会给你签名并发回证书
.key  一般公钥或者密钥都会用这种扩展名,可以是DER编码的或者是PEM编码的  

查看DER编码的(公钥或者密钥)的文件的命令为 openssl rsa -inform DER  -noout -text -in  xxx.key  

查看PEM编码的(公钥或者密钥)的文件的命令为 openssl rsa -inform PEM   -noout -text -in  xxx.key  

.p12 证书  包含一个X509证书和一个被密码保护的私钥

 

https://blog.csdn.net/do2jiang/article/details/5845031

 

3.证书的生成

     openssl、JDK中的keytool ,或者bouncy castle  http://www.bouncycastle.org/latest_releases.html

4.密钥库的标准

     

5.格式

 

ca证书与自建证书的区别

https://blog.csdn.net/sdcxyz/article/details/47220129

 

证书吊销列表 (CRL)

 

----

证书不同格式之间的转换

 

1.openssl

2.

 

服务器的类型

 

 

 

TLS与SSL的区别

https://developer.apple.com/library/content/technotes/tn2326/_index.html

 

数字签名法律问题

https://blog.csdn.net/kexiuyi/article/details/68197966

 https://blog.csdn.net/jksfkdjksdfjkjk/article/details/50962509

 

------------------------------------------------------------------------

二、数字证书的生成

 

 -------------------------------------------------ITEXT---------------------------------------------------------

 

官网

https://developers.itextpdf.com

 

三、ITEXT读写PDF的原理

 

pdf内容解读:

2 0 obj
<</Count 3/Kids[4 0 R 7 0 R 10 0 R]/Type/Pages>>
endobj

-----解决-----

对象号    产生号(第几次被修改)obj

包含在<<和>>之间的内容就是对象内容,最后以关键字endobj结束。

 

参考:

itext读写pdf的原理:https://blog.csdn.net/wzyzzu/article/details/50542562?locationNum=5&fps=1

 https://blog.csdn.net/jinshixie/article/details/51095771

 

PostScript的简略版本

 

四、地址

mavne:

http://search.maven.org/#search%7Cga%7C1%7Ccom.itextpdf

https://repo.itextsupport.com/releases/

 

五、签名

 

时间戳签名:  https://blog.csdn.net/running_snail_/article/details/52995983

水印签名:

 

隐藏签名

 

签名域(表单功能) 

 

六.文档

 

itext5--------------------------------

itext in action

https://developers.itextpdf.com/content/itext-5-examples/itext-action-second-edition

 

api文档:

http://itextsupport.com/apidocs/itext5/latest/

 

 

pdf安全:

https://developers.itextpdf.com/examples/itext-action-second-edition/chapter-12#473-encryptwithcertificate.java

https://developers.itextpdf.com/examples/itext-action-second-edition/chapter-12

 

中文的支持:

itext5:

https://www.cnblogs.com/matrix-zhu/p/6305944.html

调用 PdfFontFactory.registerSystemDirectories() 将系统字体注册进去 然后就可以创建中文字体了 PdfFont chinese = PdfFontFactory.createRegisteredFont("microsoft yahei",PdfEncodings.IDENTITY_H);

 

itext7-------------------------------

 

示例:

https://developers.itextpdf.com/content/itext-7-examples

https://developers.itextpdf.com/examples-itext7

 

api文档:

http://itextsupport.com/apidocs/itext7/latest/

 

文字检索示例:

解析psf文本内容(文字+ 坐标):

https://developers.itextpdf.com/examples/content-extraction-and-redaction/clone-parsing-pdfs

 

表单操作示例:

https://developers.itextpdf.com/content/itext-7-jump-start-tutorial/chapter-5-manipulating-existing-pdf-document

 

元数据、加密和压缩:

https://developers.itextpdf.com/content/itext-7-building-blocks/chapter-7-handling-events-setting-viewer-preferences-and-writer-properties

 

安全相关

https://developers.itextpdf.com/content/itext-7-examples/itext-7-security 

 

 别人的学习笔记

https://blog.csdn.net/column/details/18037.html

 

两种类型的数字签名:

adbe.pkcs7.sha1        首先对原文进行hash,再进行签名

adbe.pkcs7.detached    直接对原文进行签名

pdfSigner.setSignatureEvent(new PdfSigner.ISignatureEvent() {
    public void getSignatureDictionary(PdfSignature sig) {
        String subFilter = sig.getSubFilter().getValue();
        System.out.println("subFilter: " + subFilter);
    }
});

https://stackoverflow.com/questions/26468316/itext-detached-signature-means



***itext7电子签名完整参考:

http://www.mamicode.com/info-detail-1942091.html

https://blog.csdn.net/javasun608/article/details/79307845

https://www.cnblogs.com/watershine/p/6928669.html

 

移除数字签名

http://developers.itextpdf.com/examples/security/clone-remove-digital-signatures

 

中文支持:

https://blog.csdn.net/u012397189/article/details/78471319

 

 

-------------------------合法性校验----------------------------

验证电子签名的合法性: 

iText7使用IExternalSignatureContainer进行签名和验签:

https://blog.csdn.net/u013066292/article/details/78486055

 

https://segmentfault.com/q/1010000012801962  ???

 

 

 

 

七、

 PDF添加附件

 

八、

 抹除itext编辑标识

九、

 

十、

 https://git.itextsupport.com/repos?visibility=public

 

 

api文档:

http://itextsupport.com/apidocs/itext7/latest/

http://itextsupport.com/apidocs/itext5/latest/

 

--------------------------------------------------------------------------------------------------------------------------------------

https://stackoverflow.com/questions/47508108/why-i-cant-use-sha1-before-pkcs7-detached-in-itext7/47512638?noredirect=1#comment82051494_47512638

 

 

adbe.pkcs7.detached是目前用得最多的,在这里我们直接将数据进行p7不带原文签名即可; 
adbe.pkcs7.sha1则是先对数据进行哈希,然后再调用p7带原文签名。不过这种应该是后来的标准里被废除了

enter image description here

create PKCS7 with presigned data using bouncy castle

https://stackoverflow.com/questions/39378249/create-pkcs7-with-presigned-data-using-bouncy-castle

PKCS#7格式数字签名验证

https://blog.csdn.net/wzyzzu/article/details/50546960

 

Bouncy castle 签名认证机制:

https://blog.csdn.net/linyiheng123/article/details/51280140

 

【Java密码学】使用Bouncy Castle生成数字签名、数字信封

https://www.cnblogs.com/qiuxiangmuyu/p/6195215.html

 

BouncyCastle 发根证书、交叉证书、证书的例子  

http://blog.163.com/jiexun_nuaa/blog/static/68594338200751985440855/

 

Java Code Examples for org.bouncycastle.cert.X509CertificateHolder

https://www.programcreek.com/java-api-examples/index.php?api=org.bouncycastle.cert.X509CertificateHolder

 

 

pdf与word相互转换

 

-------------------------------------------------------------------------------------------------------------------------------------------

其他工具

freemarker

http://freemarker.foofun.cn

https://freemarker.apache.org

 

PDFBox

https://pdfbox.apache.org

 

 

 

上一篇: 下拉刷新上拉加载的问题

下一篇: 笔记

885 人读过
立即登录, 发表评论.
没有帐号? 立即注册
0 条评论
文档导航