However, jemarch. The question is that PDF Reference allows define new encryption methods known as security handlers, possibly provided by an external mechanism. We have discussed only the standard described by PDF Reference, which provides both V2 and AESV2 methods.
Perhaps we could support others security handlers but it will not be work for pdf-crypt, but for higher layers, I think. Since we do not know anything about the methodology they will use. They could require more knowledge of pdf objects, for example. Well, those security handlers will for sure need to use some low-level encryption algorithm that could be implemented (interfacing libgcrypt) in the crypt module. It occurs already in the standard security level too. The key is get from the object's id. The IV (for AESv2) is get from 16 first bytes from object itself. Pdf-crypt does not know anything about it. So, we can implement several methods in pdf-crypt now. But if we want to implement several security levels, perhaps it should be better write a interface to security handlers in the future. We will need to implement it in the document layer anyway.
