mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
WIP Clean Architecture
Windows 8.1 App Uses keepasslib v2.44 (temporarily)
This commit is contained in:
@@ -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 KeePassCryptographyClient: ICryptographyClient
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user