简体   繁体   English

PdfStamper类的setEncryption方法中使用哪种加密算法/方法?

[英]Which encryption algorithm/method is being used in setEncryption method of PdfStamper class?

I am referring to following method here. 我在这里指的是以下方法。 ( Link for more details) (更多信息链接

public void setEncryption(boolean strength,
                          String userPassword,
                          String ownerPassword,
                          int permissions)
                   throws DocumentException

Which encryption algorithm/method/standard is being used internally by itext to encrypt the pdf? itext内部使用哪种加密算法/方法/标准来加密pdf?

Is it AES? 是AES吗?

The Javadocs for a closely related interface, PdfEncryptionSettings , provides some clues: 紧密相关的接口的Javadocs PdfEncryptionSettings提供了一些线索:

Encryption settings are described in section 3.5 (more specifically section 3.5.2) of the PDF Reference 1.7. PDF参考1.7的3.5节(更具体地说是3.5.2节)介绍了加密设置。 They are explained in section 3.3.3 of the book 'iText in Action'. 在“ iText in Action”一书的3.3.3节中对它们进行了解释。

Looking at that section of the reference we can see that either RC4 or AES is used. 查看参考资料的那部分,我们可以看到使用了RC4或AES。

With that in mind, I'd say the specific method you linked to will either do 40-bit RC4 or 128-bit RC4. 考虑到这一点,我想说您链接到的特定方法将使用40位RC4或128位RC4。 An overloaded alternative method allows you to specify 40-bit RC4, 128-bit RC4 or 128-bit AES. 重载替代方法允许您指定40位RC4、128位RC4或128位AES。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM