Beispiel #1
0
        public void ImportKey(VaultKeyInfo keyInfo, Database db = null)
        {
            VaultKey key = VaultKeysByVaultId.AddNew();

            key.RsaKey   = keyInfo.RsaKey;
            key.Password = keyInfo.Password;
            key.Save(db);
            _items = null;
            ChildCollections.Clear();
        }
Beispiel #2
0
        public VaultKeyInfo ExportKey(Database db = null)
        {
            db = db ?? Database;
            VaultKey key = VaultKeysByVaultId.FirstOrDefault();

            _items = null;
            VaultKeysByVaultId.Delete(db);
            ChildCollections.Clear();
            VaultKeyInfo result = key.CopyAs <VaultKeyInfo>();

            return(result);
        }