Using java SDK 3.1 how to encrypt the entire binary array document and save

Application is storing the binary array document in CBS today without encryption. As per new requirement the entire document needs to be encrypted and and save. For JSON document, this is achieved using the " Field Level Encryption from the Java SDK" but not able to find any example to encrypt the entire document.
Please help.

Hi Sanjiv,

Full-document encryption is not supported by Java SDK 3.2. A workaround is to Base64-encode the binary content and store it as a String field in a JSON document; then you can use FLE to encrypt this field.

There’s a bit of overhead with that workaround (increased storage space and processing time for Base64 encoding). If the overhead is not acceptable, please get in touch with Couchbase Support so they can help prioritize adding full-document encryption to the SDK.


Hi David,

Thank you very much for your reply.
We will consider the workaround provided by you.