This sample shows one means of saving and restoring the EntityManager cache in encrypted format.
You'd like to save the contents of the EntityManager cache to a file for disconnected use. You'd also like that file to be secure from prying eyes.
This solution illustrates how to save the contents of an EntityManager cache to local storage, in encrypted form; and how to restore the saved CacheState to an EntityManager.
See Save and restore using chained streams for a simpler solution to encrypting cache files using stream chaining.