cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Encryption

alfsender
Champ in-the-making
Champ in-the-making
Hi All,

I have requirement where i have to store encrypted value in Alfresco. I know in Alfresco we have a type d:encrypted. For that i need to configure encryption certificate in Alfresco. What my problem is i can not do that, as there is an existing internal service with client that we have to use for encryption/decryption.

This service gives encrypted value in response, so i am getting byte array,  which i cant store in alfresco available data types.

I tried creating a SealedObject, but that also didn't work as i have to pass cipher while creating object, which i don't have.

One more thing is i am calling this web-service for encryption through java-script based web-script, so i need a way where i can store either inputstream or byte array to Alfresco property. is it possible to store inputstream or byte array to Alfresco property, if yes then what should be the data type of that property and how to store it through java-script.

Request for your valuable inputs.

Thank you.

2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

a lot of points to cover here:

- d:encrypted is a special type of property where you can put any kind of data object that is serializable - but you can only update / read these kinds of properties from custom Java code which has to use the MetadataEncryptor utility bean of Alfresco
- you can store any kind of serializable data using d:any - if you've got a byte array of data, simply wrap that in a serializable Java object and put it in a d:any field
- you can not store any kind of input stream as these don't have any intrinsic value and only provide means to access some data from an arbitrary source (file, network, database, whatever)
- if you absolutely have / need to write your web script code in JavaScript, you will have to write up some extensions to the JavaScript API using Java

Regards
Axel

alfsender
Champ in-the-making
Champ in-the-making
Thank you, this is what i was looking for.