Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Karim BOUAMI
Encrypting documents in Document & Media Library
25. April 2013 08:32
Antwort

Karim BOUAMI

Rang: New Member

Nachrichten: 3

Eintrittsdatum: 11. April 2013

Neue Beiträge

Hi,
I would like to encrypt the documents uploaded in Document & Media Library before storing it on a another server than the one LifeRay is in.
So how can I do that? I know how to change the storage location for the documents but for the encryption part, I'm not too sure how to do it exactly.
Please Help me!
Thanks in advance!
Jeffrey Handa
RE: Encrypting documents in Document & Media Library
25. April 2013 09:40
Antwort

Jeffrey Handa

LIFERAY STAFF

Rang: Liferay Master

Nachrichten: 501

Eintrittsdatum: 1. Dezember 2008

Neue Beiträge

Hi Karim,

You want Liferay to handle the encryption, and not just put the document on a drive that is encrypted? If that's the case I think I'd look at implementing a custom document store that extends com.liferay.portlet.documentlibrary.store.BaseStore. You can tell Liferay to use your custom store by setting the dl.store.impl property in your portal-ext.properties file. Take a look at the existing document stores to get an idea of how they work.

Regards,
Jeff
Karim BOUAMI
RE: Encrypting documents in Document & Media Library
30. April 2013 01:12
Antwort

Karim BOUAMI

Rang: New Member

Nachrichten: 3

Eintrittsdatum: 11. April 2013

Neue Beiträge

Hi Jeff,

First, thank you for your answer!
As for your answer, it's exactly as you said, I want LifeRay to handle the encryption. However Isn't there an easier way to do it than creating a document store (which seems as a hard feat)? I was thinking about using a class that would encrypt the document and on the other way decrypt the file when a user wants to download the document, the rest of the mecanisms would stay the same. Is it possible to do so? If it is possible, how can I manage to that?
Thanks in advance for the answers!
Jeffrey Handa
RE: Encrypting documents in Document & Media Library
1. Mai 2013 06:37
Antwort

Jeffrey Handa

LIFERAY STAFF

Rang: Liferay Master

Nachrichten: 501

Eintrittsdatum: 1. Dezember 2008

Neue Beiträge

Hi Karim,

I agree writing a new document store from scratch would be quite daunting, but if you extend Liferay's Advanced File System document store I think you would only have to modify/add a small amount of code. Since the original code is in portal-impl you might need to create your class in an EXT Plugin.

Another approach that you might consider would be to override the appropriate services in Liferay using a Service Wrapper Hook. The Document Library (DL) services are a little more complicated than other services so I recommend doing a little research before you start overriding services. If you have access to a copy of Liferay in Action, I'd recommend you take a look at Appendix E which has a very good summary of the Liferay 6.1 Documents API.

One other item to consider is if you want the contents of the uploaded files to be indexed and searchable through Liferay. As part of the upload process Liferay will attempt to index the contents of the file so if you didn't want them indexed for some reason that might have an impact on where you put your code.
Abhed Dekavadiya
RE: Encrypting documents in Document & Media Library
22. November 2013 00:46
Antwort

Abhed Dekavadiya

Rang: Junior Member

Nachrichten: 74

Eintrittsdatum: 5. Oktober 2010

Neue Beiträge

Hello Jeffery,

I have a scenario where I am using Amazon S3 for document storage and I need to send an additional parameter to encrypt documents at S3 server side. For the same, there is no portal property or any overloaded method. So I will have to change the addFile() method of S3Store.java to add an additional line
1
2s3Object.setServerSideEncryptionAlgorithm(S3Object.SERVER_SIDE_ENCRYPTION__AES256);


Now, considering this scenario and the service structure of document library, I see that only EXT plugin is the way to go ahead.
Do you see if I could still achieve this through Service Wrapper Hook ?

Thanks in advance!

regards,
Abhed Dekavadiya