PdfEncryptedPayload Class
The encrypted payload of an unencrypted wrapper document (ISO 32000-2, 7.6.7): an encrypted PDF document embedded in a document that is not encrypted, so that a reader without the cryptographic filter of the payload can show the pages of the wrapper (usually a page that explains how to open the payload).
public sealed class PdfEncryptedPayloadRemarks
The file specification of the payload has the relationship PdfAssociatedFileRelationship.EncryptedPayload and an encrypted payload dictionary (/EP, Table 28) naming the cryptographic filter; the /Collection of the catalog names the payload (/D) and hides the list of the files (/View /H).
Properties
| Name | Description |
|---|---|
| CryptographicFilter | Gets the name of the cryptographic filter the payload is encrypted with (/Subtype), so that a reader can tell whether it can open it. |
| Dictionary | Gets the encrypted payload dictionary (/EP of the file specification). |
| File | Gets the embedded file that holds the payload. |
| Version | Gets the version of the cryptographic filter (/Version), or null. |
CryptographicFilter
PdfEncryptedPayload.csDictionary
PdfEncryptedPayload.csGets the encrypted payload dictionary (/EP of the file specification).
public PdfDictionary Dictionary { get; }Property value
Version
PdfEncryptedPayload.csMethods
| Name | Description |
|---|---|
| GetData() | Gets the bytes of the payload document. |
| OpenDocument(PdfReadOptions?) | Reads the payload document. |
GetData()
PdfEncryptedPayload.csGets the bytes of the payload document.
public byte[] GetData()Returns
byte[] The bytes, decoded with the limits of the wrapper document.
Exceptions
InvalidPdfContentException- The file specification has no embedded file stream, or the stream cannot be decoded.
PdfResourceLimitException- The decoded payload exceeds
PdfReadOptions.MaxDecodedStreamLengthof the wrapper document.
OpenDocument(PdfReadOptions?)
PdfEncryptedPayload.csReads the payload document.
public PdfDocument OpenDocument(PdfReadOptions? options = null)Parameters
optionsPdfReadOptions?- The options of the payload, with its password;
nullforPdfReadOptions.Default.
Returns
PdfDocument The payload document.
Exceptions
InvalidPdfContentException- The payload is not a PDF document.
UnsupportedPdfFeatureException- The payload is encrypted with a security handler the library does not support: only the standard security handler is.
PdfPasswordException- The password of the options does not open the payload.