the key must be 16 bytes long.
and do not pass OpenStream.
byte[] key = "MySecretKeyABCDE".getBytes(); //must be 16 bytes length, get byte array as key to encryption
stream.open("/sdcard/ttt.pdf", key); //create PDF file as encrypted PDF file.
stream.ImportFromFile("/sdcard/test.pdf"); //load contents, and then encrypt it to ttt.pdf
stream.ExportToFile("/sdcard/test1.pdf"); //decrypt contents, and then export ro test1.pdf, so test1.pdf shall same to test.pdf, this step just for test purpose.
stream.close(); //flush ttt.pdf and close file.
//now open the encrypted PDF file:
byte[] key = "MySecretKeyABCDE".getBytes(); //must be 16 bytes length, get byte array as key to encryption
stream.open("/sdcard/ttt.pdf", key);
m_doc.OpenStream(stream, null);
//to do...
m_doc.Close();
stream.close();