I have added below lines in nuxeo.conf
nuxeo.core.binarymanager=org.nuxeo.ecm.core.blob.binary.AESBinaryManager
nuxeo.core.binarymanager_key=password=mypassword
I was already having some files already available in binaries folder which were in plain format (not encrypted).
So i tried to create document with encryption then i am getting Invalid Type (Bad Magic) exception . it is because the MD5 which is getting generated with encryption technique is already available in plain format (with out encryption) in binary folder.
and it is giving issue in below line:-
**protected void decrypt(InputStream in, OutputStream out) throws IOException {
byte[] magic = new byte[FILE_MAGIC.length];
IOUtils.read(in, magic);
if (!Arrays.equals(magic, FILE_MAGIC)) {
throw new IOException("Invalid file (bad magic)");
}
**
Resolution on my end:-
I have deleted content of binary/data folder and deleted the folder structure from webUi ex: XXX/workspaces/YYY
and created doc with encryption it is working fine.
PROBLEM:
So I want to know is there any possibility that we can bring AESEncryption on demand . so it will not hamper already generated file in plain format.
If i want to remove encryption i can remove it.
and is there any possibility i can apply encryption on tenant specific.