mozilla/pdf.js — pull request #1695 by saebekassebil (2012-05-13 10:43:10+00:00)
Title: Support password protected PDF files - With user input

This PR (tries to) solve(s) the problem we've had with password protected PDF files. Right now the process is as follows:
- getDocument() tries to open the PDF file
- Since the PDF is encrypted, the `CipherTransformFactory` gets instantiated and tries to decode the PDF
- Since no password has been supplied, it throws a `PasswordException`, which is catched by the Worker
- The Worker requests a password from client (API -> Viewer)
- The viewer *prompt*s (yes I know it's ugly), the user for a password
- The getDocument method is now supplied with a password, which is hopefully the correct one.

This PR implements `PasswordException` located in `src/util.js` and an `isEncrypted` method to the API (`src/api.s`)

We've had a wrong password/encryption algorithm implementation, but this has just been solved by @yurydelendik #1694

This PR solves/closes #1228 and #1621