Ejemplo n.º 1
0
        public LocalRecordStore(IRecord record, StorageFolder folder, string encryptionKey)
        {
            IObjectStore store = new FolderObjectStore(folder);
            if (!String.IsNullOrEmpty(encryptionKey))
            {
                store = new EncryptedObjectStore(store, new Cryptographer(), encryptionKey);
            }

            Initialize(record, store, null);
        }
Ejemplo n.º 2
0
        private void HandleEncryptionSetCache()
        {
            // Set up the encrypted local vault
            if (m_appSettings.UseEncryption)
            {
                var encryptedStore = new EncryptedObjectStore(
                    FolderObjectStore.CreateRoot(m_appSettings.Folder),
                    Client.Cryptographer,
                    Client.State.ProvisioningInfo.SharedSecret);

                m_localVault = new LocalVault(
                    this,
                    FolderObjectStore.CreateRoot(m_appSettings.Folder),
                    encryptedStore);
            }

            // Set the cache setting
            m_localVault.RecordStores.MaxCachedItems = m_appSettings.MaxCachedItems;
        }
Ejemplo n.º 3
0
        static IObjectStore CreateObjectStore(StorageFolder container, string encryptionKey)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            IObjectStore store = new FolderObjectStore(container);
            if (!string.IsNullOrEmpty(encryptionKey))
            {
                store = new EncryptedObjectStore(store, new Cryptographer(), encryptionKey);
            }

            return store;
        }