iText 9.0.0 API
|
Public Member Functions |
|
PdfEncryption (byte[] userPassword, byte[] ownerPassword, int permissions, int encryptionType, byte[] documentId, PdfVersion version, AbstractMacIntegrityProtector macContainer) | |
Creates the encryption. More... |
|
PdfEncryption (IX509Certificate[] certs, int[] permissions, int encryptionType, PdfVersion version, AbstractMacIntegrityProtector macContainer) | |
Creates the certificate encryption. More... |
|
PdfEncryption (PdfDictionary pdfDict, byte[] password, byte[] documentId) | |
Creates PdfEncryption instance based on already existing standard encryption dictionary. More... |
|
PdfEncryption (PdfDictionary pdfDict, IPrivateKey certificateKey, IX509Certificate certificate) | |
Creates PdfEncryption instance based on already existing public encryption dictionary. More... |
|
virtual ? int | GetPermissions () |
Gets the encryption permissions. More... |
|
virtual int | GetCryptoMode () |
Gets encryption algorithm and access permissions. More... |
|
virtual int | GetEncryptionAlgorithm () |
Gets encryption algorithm. More... |
|
virtual bool | IsMetadataEncrypted () |
virtual bool | IsEmbeddedFilesOnly () |
virtual byte[] | GetDocumentId () |
virtual void | SetHashKeyForNextObject (int objNumber, int objGeneration) |
virtual OutputStreamEncryption | GetEncryptionStream (Stream os) |
virtual byte[] | EncryptByteArray (byte[] b) |
virtual byte[] | DecryptByteArray (byte[] b) |
virtual bool | IsOpenedWithFullPermission () |
virtual byte[] | ComputeUserPassword (byte[] ownerPassword) |
Computes user password if standard encryption handler is used with Standard40, Standard128 or AES128 algorithm. More... |
|
override void | Flush () |
To manually flush a PdfObject behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference. More... |
|
![]() |
|
virtual T | GetPdfObject () |
virtual iText.Kernel.Pdf.PdfObjectWrapper< T > | MakeIndirect (PdfDocument document, PdfIndirectReference reference) |
Marks object behind wrapper to be saved as indirect. More... |
|
virtual iText.Kernel.Pdf.PdfObjectWrapper< T > | MakeIndirect (PdfDocument document) |
Marks object behind wrapper to be saved as indirect. More... |
|
virtual iText.Kernel.Pdf.PdfObjectWrapper< T > | SetModified () |
virtual bool | IsFlushed () |
Static Public Member Functions |
|
static byte[] | GenerateNewDocumentId () |
static PdfObject | CreateInfoId (byte[] id, bool modified) |
Creates a PdfLiteral that contains an array of two id entries. More... |
|
static PdfObject | CreateInfoId (byte[] firstId, byte[] secondId, bool preserveEncryption) |
Creates a PdfLiteral that contains an array of two id entries. More... |
|
Package Functions |
|
override bool | IsWrappedObjectMustBeIndirect () |
Defines if the object behind this wrapper must be an indirect object in the resultant document. More... |
|
![]() |
|
PdfObjectWrapper (T pdfObject) | |
virtual void | SetPdfObject (T pdfObject) |
virtual void | SetForbidRelease () |
virtual void | UnsetForbidRelease () |
virtual void | EnsureUnderlyingObjectHasIndirectReference () |
Additional Inherited Members |
|
![]() |
|
static void | MarkObjectAsIndirect (PdfObject pdfObject) |
static void | EnsureObjectIsAddedToDocument (PdfObject @object) |
Some wrappers use object's indirect reference to obtain the PdfDocument to which the object belongs to. More... |
|
|
inline |
Creates the encryption.
userPassword | the user password. Can be null or of zero length, which is equal to omitting the user password |
ownerPassword | the owner password. If it's null or empty, iText will generate a random string to be used as the owner password |
permissions | the user permissions The open permissions for the document can be EncryptionConstants.ALLOW_PRINTING , EncryptionConstants.ALLOW_MODIFY_CONTENTS , EncryptionConstants.ALLOW_COPY , EncryptionConstants.ALLOW_MODIFY_ANNOTATIONS , EncryptionConstants.ALLOW_FILL_IN , EncryptionConstants.ALLOW_SCREENREADERS , EncryptionConstants.ALLOW_ASSEMBLY and EncryptionConstants.ALLOW_DEGRADED_PRINTING. The permissions can be combined by ORing them |
encryptionType | the type of encryption. It can be one of EncryptionConstants.STANDARD_ENCRYPTION_40 , EncryptionConstants.STANDARD_ENCRYPTION_128 , EncryptionConstants.ENCRYPTION_AES_128 or EncryptionConstants.ENCRYPTION_AES_256. Optionally EncryptionConstants.DO_NOT_ENCRYPT_METADATA can be ORed to output the metadata in cleartext. EncryptionConstants.EMBEDDED_FILES_ONLY can be ORed as well. Please be aware that the passed encryption types may override permissions: EncryptionConstants.STANDARD_ENCRYPTION_40 implicitly sets EncryptionConstants.DO_NOT_ENCRYPT_METADATA and EncryptionConstants.EMBEDDED_FILES_ONLY as false; EncryptionConstants.STANDARD_ENCRYPTION_128 implicitly sets EncryptionConstants.EMBEDDED_FILES_ONLY as false; |
documentId | document id which will be used for encryption |
version | the PdfVersion of the target document for encryption |
macContainer |
iText.Kernel.Mac.AbstractMacIntegrityProtector class for MAC integrity protection
|
inline |
Creates the certificate encryption.
Creates the certificate encryption.
An array of one or more public certificates must be provided together with an array of the same size for the permissions for each certificate.
iText.Kernel.Mac.AbstractMacIntegrityProtector class for MAC integrity protection
|
inline |
Creates PdfEncryption instance based on already existing standard encryption dictionary.
pdfDict |
PdfDictionary , which represents encryption dictionary
password |
byte[]
, which represents encryption password
documentId | original file ID, the first element in PdfName.ID key of trailer |
|
inline |
Creates PdfEncryption instance based on already existing public encryption dictionary.
pdfDict |
PdfDictionary , which represents encryption dictionary
certificateKey | the recipient private iText.Commons.Bouncycastle.Crypto.IPrivateKey to the certificate |
certificate | the recipient iText.Commons.Bouncycastle.Cert.IX509Certificate , which serves as recipient identifier |
certificateKeyProvider | the certificate key provider id for Java.Security.Security.GetProvider(System.String) |
externalDecryptionProcess |
iText.Kernel.Security.IExternalDecryptionProcess the external decryption process to be used
|
inlinevirtual |
Computes user password if standard encryption handler is used with Standard40, Standard128 or AES128 algorithm.
ownerPassword | owner password of the encrypted document. |
|
inlinestatic |
Creates a PdfLiteral that contains an array of two id entries.
Creates a PdfLiteral that contains an array of two id entries. These entries are both hexadecimal strings containing up to 16 hex characters. The first entry is the original id, the second entry should be different from the first one if the document has changed.
firstId | the first id |
secondId | the second id |
preserveEncryption | the encryption preserve |
|
inlinestatic |
Creates a PdfLiteral that contains an array of two id entries.
Creates a PdfLiteral that contains an array of two id entries. These entries are both hexadecimal strings containing 16 hex characters. The first entry is the original id, the second entry should be different from the first one if the document has changed.
id | the first id |
modified | whether the document has been changed or not |
|
inlinevirtual |
To manually flush a PdfObject
behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference.
To manually flush a PdfObject
behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference. Basically this means that before flushing you need to explicitly call PdfObjectWrapper
Reimplemented from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >.
|
inlinevirtual |
Gets encryption algorithm and access permissions.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Gets the encryption permissions.
Gets the encryption permissions. It can be used directly in WriterProperties.SetStandardEncryption(byte[], byte[], int, int). See ISO 32000-1, Table 22 for more details.
|
inlinepackagevirtual |
Defines if the object behind this wrapper must be an indirect object in the resultant document.
Defines if the object behind this wrapper must be an indirect object in the resultant document.
If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.
Return value of this method shouldn't depend on any logic, it should return always true or false.
Implements iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >.