Added a cryptography service to encrypt protected information (unused atm)

Corrected a bug when deleting recycle bin
This commit is contained in:
Geoffroy BONNEVILLE
2020-05-14 12:05:05 +02:00
parent 2e01fa2212
commit 72e5bf4ee1
14 changed files with 87 additions and 24 deletions

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using ModernKeePass.Application.Common.Interfaces;
using ModernKeePass.Domain.Entities;
using ModernKeePassLib;
using ModernKeePassLib.Cryptography.Cipher;
using ModernKeePassLib.Cryptography.KeyDerivation;
namespace ModernKeePass.Infrastructure.KeePass
{
public class KeePassDatabaseSettingsProxy: IDatabaseSettingsProxy
{
public IEnumerable<BaseEntity> Ciphers
{
get
{
for (var inx = 0; inx < CipherPool.GlobalPool.EngineCount; inx++)
{
var cipher = CipherPool.GlobalPool[inx];
yield return new BaseEntity
{
Id = cipher.CipherUuid.ToHexString(),
Name = cipher.DisplayName
};
}
}
}
public IEnumerable<BaseEntity> KeyDerivations => KdfPool.Engines.Select(e => new BaseEntity
{
Id = e.Uuid.ToHexString(),
Name = e.Name
});
public IEnumerable<string> CompressionAlgorithms => Enum.GetNames(typeof(PwCompressionAlgorithm)).Take((int) PwCompressionAlgorithm.Count);
}
}