mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
ModernKeePassLib custom PCL version
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using Windows.Storage;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ModernKeePass.ViewModels;
|
||||
using ModernKeePassLib;
|
||||
using ModernKeePassLib.Interfaces;
|
||||
@@ -23,13 +22,14 @@ namespace ModernKeePass.Common
|
||||
{
|
||||
this.databaseFile = databaseFile;
|
||||
}
|
||||
public async Task<string> Open(string password)
|
||||
public string Open(string password)
|
||||
{
|
||||
var key = new CompositeKey();
|
||||
try
|
||||
{
|
||||
key.AddUserKey(new KcpPassword(password));
|
||||
await _pwDatabase.Open(IOConnectionInfo.FromFile(databaseFile), key, new NullStatusLogger());
|
||||
_pwDatabase.Open(IOConnectionInfo.FromFile(databaseFile), key, new NullStatusLogger());
|
||||
//_pwDatabase.Open(IOConnectionInfo.FromPath(databaseFile.Path), key, new NullStatusLogger());
|
||||
IsOpen = _pwDatabase.IsOpen;
|
||||
Name = databaseFile.DisplayName;
|
||||
RootGroup = new GroupVm(_pwDatabase.RootGroup);
|
||||
@@ -42,6 +42,10 @@ namespace ModernKeePass.Common
|
||||
{
|
||||
return "Wrong password";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ex.Message;
|
||||
}
|
||||
/*finally
|
||||
{
|
||||
// TODO: move this when implementing write mode
|
||||
|
Reference in New Issue
Block a user