Skip to content

Commit 7d7d386

Browse files
Retrieve signatures data
1 parent c7cbdc6 commit 7d7d386

File tree

8 files changed

+2116
-625
lines changed

8 files changed

+2116
-625
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (c) Files Community
2+
// Licensed under the MIT License.
3+
4+
namespace Files.App.Data.Items
5+
{
6+
public class CertNodeInfoItem
7+
{
8+
public string IssuedTo { get; set; } = string.Empty;
9+
10+
public string IssuedBy { get; set; } = string.Empty;
11+
12+
public string Version { get; set; } = string.Empty;
13+
14+
public string SerialNumber { get; set; } = string.Empty;
15+
16+
public string Thumbprint { get; set; } = string.Empty;
17+
18+
public string ValidFrom { get; set; } = string.Empty;
19+
20+
public string ValidTo { get; set; } = string.Empty;
21+
22+
public string SignAlgorithm { get; set; } = string.Empty;
23+
}
24+
}

src/Files.App/Data/Models/SignatureInfoItem.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,15 @@ public bool Verified
6060
}
6161
}
6262

63+
public List<CertNodeInfoItem> SignChain { get; }
64+
6365
public string Glyph => Verified ? "\uE930" : "\uEA39";
6466

6567
public ICommand OpenDetailsCommand { get; }
6668

67-
public SignatureInfoItem()
69+
public SignatureInfoItem(List<CertNodeInfoItem> chain)
6870
{
71+
SignChain = chain ?? new List<CertNodeInfoItem>();
6972
OpenDetailsCommand = new AsyncRelayCommand(DoOpenDetails);
7073
}
7174

src/Files.App/Helpers/Win32/Win32Helper.Storage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,13 +904,13 @@ public static SafeFileHandle OpenFileForRead(string filePath, bool readWrite = f
904904
(uint)FILE_ACCESS_RIGHTS.FILE_GENERIC_READ | (uint)(readWrite ? FILE_ACCESS_RIGHTS.FILE_GENERIC_WRITE : 0u), (uint)(Win32PInvoke.FILE_SHARE_READ | (readWrite ? 0 : Win32PInvoke.FILE_SHARE_WRITE)), IntPtr.Zero, Win32PInvoke.OPEN_EXISTING, (uint)Win32PInvoke.File_Attributes.BackupSemantics | flags, IntPtr.Zero), true);
905905
}
906906

907-
public static bool GetFileDateModified(string filePath, out FILETIME dateModified)
907+
public static bool GetFileDateModified(string filePath, out System.Runtime.InteropServices.ComTypes.FILETIME dateModified)
908908
{
909909
using var hFile = new SafeFileHandle(Win32PInvoke.CreateFileFromApp(filePath, (uint)FILE_ACCESS_RIGHTS.FILE_GENERIC_READ, Win32PInvoke.FILE_SHARE_READ, IntPtr.Zero, Win32PInvoke.OPEN_EXISTING, (uint)Win32PInvoke.File_Attributes.BackupSemantics, IntPtr.Zero), true);
910910
return Win32PInvoke.GetFileTime(hFile.DangerousGetHandle(), out _, out _, out dateModified);
911911
}
912912

913-
public static bool SetFileDateModified(string filePath, FILETIME dateModified)
913+
public static bool SetFileDateModified(string filePath, System.Runtime.InteropServices.ComTypes.FILETIME dateModified)
914914
{
915915
using var hFile = new SafeFileHandle(Win32PInvoke.CreateFileFromApp(filePath, (uint)FILE_ACCESS_RIGHTS.FILE_WRITE_ATTRIBUTES, 0, IntPtr.Zero, Win32PInvoke.OPEN_EXISTING, (uint)Win32PInvoke.File_Attributes.BackupSemantics, IntPtr.Zero), true);
916916
return Win32PInvoke.SetFileTime(hFile.DangerousGetHandle(), new(), new(), dateModified);

0 commit comments

Comments
 (0)