} catch (Exception e) {
throw new RuntimeException("The Configured JCE Provider is not available");
}
// Create the entry to encrypt
AbderaSecurity absec = new AbderaSecurity(abdera);
Factory factory = abdera.getFactory();
Entry entry = factory.newEntry();
entry.setId("http://example.org/foo/entry");
entry.setUpdated(new java.util.Date());
entry.setTitle("This is an entry");
entry.setContentAsXhtml("This <b>is</b> <i>markup</i>");
entry.addAuthor("James");
entry.addLink("http://www.example.org");
// Prepare the Diffie-Hellman Key Exchange Session
// There are two participants in the session, A and B
// Each has their own DHContext. A creates their context and
// sends the request key parameters to B. B uses those parameters
// to create their context, the returns it's public key
// back to A.
DHContext context_a = new DHContext();
DHContext context_b = new DHContext(context_a.getRequestString());
context_a.setPublicKey(context_b.getResponseString());
// Prepare the encryption options
Encryption enc = absec.getEncryption();
// Encrypt the document using A's DHContext
EncryptionOptions options = context_a.getEncryptionOptions(enc);
Document enc_doc = enc.encrypt(entry.getDocument(), options);