Read / Writing to encrypted PDF documents (iOS / obj-c)

Is is possible to read from / view encrypted PDF files using the Objective-C version of the PDFNet SDK? I’m already accomplishing this via the Java SDK by doing the following…

`
// My PDF viewer
PDFViewCtrl viewer;
// Stream to the encrypted document’s file data
FileInputStream streamIn;
// Cipher used to decrypt document data
Cipher decryptCipher;

// Define a cipher stream that will be able to decrypt
// all document data for the PDF viewer
CipherInputStream decryptStream = new CipherInputStream(streamIn, decryptCipher);

// Initialize a new document using the decryption
// stream and display it in the PDF viewer
PDFDoc doc = new PDFDoc(decryptStream);
viewer.setDoc(doc);
`

I’ve been digging around the documentation and it seems like I may be able to accomplish this using PTFDFDoc’s initWithStream call and a PTFilter or PTFilterReader but the documentation is vague and confusing.

Am I on the right trail? If so, how should I define a PTFilter. If not, what should I be doing instead?

PDFNet requires random access of the PDF source to properly parse and load the document. You should be able to do the same operation in Objective-C by loading the decrypted PDF into a buffer pointed by NSData* then pass it to the initWithBuf constructor of PTPDFDoc (see: https://www.pdftron.com/pdfnet/mobile/docs/iOS/src/interface_p_t_p_d_f_doc.html#aabad517d1a6feca161c86c7173c09b0b).