// Encrypt the document using A's DHContext
EncryptionOptions options = context_a.getEncryptionOptions(enc);
Document enc_doc = enc.encrypt(entry.getDocument(), options);
enc_doc.writeTo(System.out);
System.out.println("\n\n");
// Decrypt the document using B's DHContext
options = context_b.getEncryptionOptions(enc);