Skip to content

Commit

Permalink
v1.18.30
Browse files Browse the repository at this point in the history
  • Loading branch information
perevoznyk committed Nov 14, 2024
1 parent 3867baa commit 1ec3771
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 48 deletions.
7 changes: 7 additions & 0 deletions C++/include/Swelio.h
Original file line number Diff line number Diff line change
Expand Up @@ -1772,6 +1772,13 @@ void WINAPI IgnoreServiceEvents(BOOL value);
/// <returns>None</returns>
void WINAPI IgnoreHardwareEvents(BOOL value);

/// <summary>
/// Ignore Unknown cards insert / remove events
/// </summary>
/// <param name="value">true - to ignore unknown cards remove / insert events</param>
/// <returns>None</returns>
void WINAPI IgnoreUnknownCards(BOOL value);

// Summary:
// Digitally sign PDF file using Belgian EID card
// Description:
Expand Down
Binary file modified C++/lib/Swelio32.lib
Binary file not shown.
Binary file modified C++/lib/Swelio64.lib
Binary file not shown.
Binary file modified Redist/Swelio32.dll
Binary file not shown.
Binary file modified Redist/Swelio64.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Samples/C#/EIDTestApp/EIDTestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
Expand Down
4 changes: 2 additions & 2 deletions Samples/C#/EIDTestApp/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ private void ActivateCardEventsTracing()
engine.CardInserted += new EventHandler<CardEventArgs>(engine_CardInserted);
engine.CardRemoved += new EventHandler<CardEventArgs>(engine_CardRemoved);
engine.ReadersListChanged += new EventHandler(engine_ReadersListChanged);
engine.TraceHardwareEvents = true;
engine.TraceServiceEvents = true;
engine.TraceHardwareEvents = false;
engine.TraceServiceEvents = false;
engine.TraceEvents = true;
}

Expand Down
2 changes: 1 addition & 1 deletion Samples/C#/EIDTestApp/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Samples/C#/EIDTestApp/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Samples/C#/EIDTestApp/app.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
19 changes: 11 additions & 8 deletions Samples/C#/PDFSignature/PDFSignature/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ class Program
{
static void Main(string[] args)
{
PdfDocument pdf = new PdfDocument(args[0]);
Manager manager = new Manager();
manager.Active = true;
manager.GetReader(0).ActivateCard();
pdf.SelectCertificate(0);
pdf.Sign();
pdf.Close();
manager.Active = false;
if (args.Length > 0)
{
PdfDocument pdf = new PdfDocument(args[0]);
Manager manager = new Manager();
manager.Active = true;
manager.GetReader(0).ActivateCard();
pdf.SelectCertificate(0);
pdf.Sign();
pdf.Close();
manager.Active = false;
}
}
}
}
10 changes: 3 additions & 7 deletions Samples/C#/PhotoMimeEncoding/PhotoMimeEncoding.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PhotoMimeEncoding</RootNamespace>
<AssemblyName>PhotoMimeEncoding</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand Down Expand Up @@ -42,6 +42,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -50,6 +51,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -60,12 +62,6 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Binding\C#\Swelio.Engine\Swelio.Engine\Swelio.Engine.csproj">
<Project>{AACADA10-0AB6-4845-8B13-87A7FA86AE69}</Project>
<Name>Swelio.Engine</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
Expand Down
21 changes: 2 additions & 19 deletions Samples/C#/PhotoMimeEncoding/PhotoMimeEncoding.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
# Visual Studio Version 17
VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhotoMimeEncoding", "PhotoMimeEncoding.csproj", "{170135AC-25B3-436B-8491-417AF9CF650A}"
ProjectSection(ProjectDependencies) = postProject
{AACADA10-0AB6-4845-8B13-87A7FA86AE69} = {AACADA10-0AB6-4845-8B13-87A7FA86AE69}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Swelio.Engine", "..\..\..\Binding\C#\Swelio.Engine\Swelio.Engine\Swelio.Engine.csproj", "{AACADA10-0AB6-4845-8B13-87A7FA86AE69}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -28,18 +23,6 @@ Global
{170135AC-25B3-436B-8491-417AF9CF650A}.Release|Any CPU.Build.0 = Release|Any CPU
{170135AC-25B3-436B-8491-417AF9CF650A}.Release|x64.ActiveCfg = Release|Any CPU
{170135AC-25B3-436B-8491-417AF9CF650A}.Release|x86.ActiveCfg = Release|Any CPU
{AACADA10-0AB6-4845-8B13-87A7FA86AE69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AACADA10-0AB6-4845-8B13-87A7FA86AE69}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AACADA10-0AB6-4845-8B13-87A7FA86AE69}.Debug|x64.ActiveCfg = Debug|x64
{AACADA10-0AB6-4845-8B13-87A7FA86AE69}.Debug|x64.Build.0 = Debug|x64
{AACADA10-0AB6-4845-8B13-87A7FA86AE69}.Debug|x86.ActiveCfg = Debug|x86
{AACADA10-0AB6-4845-8B13-87A7FA86AE69}.Debug|x86.Build.0 = Debug|x86
{AACADA10-0AB6-4845-8B13-87A7FA86AE69}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AACADA10-0AB6-4845-8B13-87A7FA86AE69}.Release|Any CPU.Build.0 = Release|Any CPU
{AACADA10-0AB6-4845-8B13-87A7FA86AE69}.Release|x64.ActiveCfg = Release|x64
{AACADA10-0AB6-4845-8B13-87A7FA86AE69}.Release|x64.Build.0 = Release|x64
{AACADA10-0AB6-4845-8B13-87A7FA86AE69}.Release|x86.ActiveCfg = Release|x86
{AACADA10-0AB6-4845-8B13-87A7FA86AE69}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion Samples/C#/PhotoMimeEncoding/app.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
2 changes: 1 addition & 1 deletion Samples/C#/Signature/Signature/Signature.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Signature</RootNamespace>
<AssemblyName>Signature</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/C#/Signature/Signature/app.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
16 changes: 14 additions & 2 deletions Swelio.Engine/Swelio.Engine/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public sealed class Manager : IDisposable
private bool traceEvents;
private bool traceServiceEvents;
private bool traceHardwareEvents;
private bool ignoreUnknownCards;

private ReaderCallbackDelegate InternalCallbackDelegate;

Expand All @@ -31,8 +32,9 @@ public sealed class Manager : IDisposable
public Manager()
{
readers = new List<CardReader>();
traceHardwareEvents = true;
traceServiceEvents = true;
traceHardwareEvents = false; //Do not trace card readers list change events
traceServiceEvents = false; //Do not trace service start and stop
ignoreUnknownCards = true; //Ignore unsopported cards insertion / removal
InternalCallbackDelegate = new ReaderCallbackDelegate(EventTracer);
}

Expand Down Expand Up @@ -169,6 +171,16 @@ public bool TraceHardwareEvents
}
}

public bool IgnoreUnknownCards
{
get { return ignoreUnknownCards; }
set
{
ignoreUnknownCards = value;
NativeMethods.IgnoreUnknownCards(value);
}
}

public event EventHandler<CardEventArgs> CardInserted;
public event EventHandler<CardEventArgs> CardRemoved;
public event EventHandler ReadersListChanged;
Expand Down
3 changes: 3 additions & 0 deletions Swelio.Engine/Swelio.Engine/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ internal static class NativeMethods
[DllImport(DLL_FILE_NAME, EntryPoint = "IgnoreHardwareEvents", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)]
public static extern void IgnoreHardwareEvents(bool value);

[DllImport(DLL_FILE_NAME, EntryPoint = "IgnoreUnknownCards", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)]
public static extern void IgnoreUnknownCards(bool value);

[DllImport(DLL_FILE_NAME, EntryPoint = "RemoveStartupW", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)]
public static extern void RemoveStartup([MarshalAs(UnmanagedType.LPWStr)] string AppName);

Expand Down
7 changes: 7 additions & 0 deletions Swelio.Engine/Swelio.Engine/PdfDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace Swelio.Engine
{
/// <summary>
/// The digital signature for PDF documents
/// </summary>
public class PdfDocument
{
private string fileName;
Expand All @@ -14,6 +17,10 @@ public class PdfDocument
private bool certificateSelected = false;


/// <summary>
/// Initializes a new instance of the <see cref="PdfDocument"/> class.
/// </summary>
/// <param name="fileName">The file name.</param>
public PdfDocument(string fileName)
{
this.fileName = fileName;
Expand Down
9 changes: 6 additions & 3 deletions Swelio.Engine/Swelio.Engine/Swelio.Engine.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;net472;net48</TargetFrameworks>
<TargetFrameworks>net462;net472;net48;net8.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.18.29</Version>
<Version>1.18.30</Version>
<Authors>Serhiy Perevoznyk</Authors>
<Company>Serhiy Perevoznyk</Company>
<Product>Swelio</Product>
Expand All @@ -13,7 +13,7 @@
<RepositoryUrl>https://github.com/perevoznyk/swelio-sdk</RepositoryUrl>
<PackageProjectUrl>https://github.com/perevoznyk</PackageProjectUrl>
<PackageIcon>Swelio_icon.png</PackageIcon>
<Copyright>Copyright © Serhiy Perevoznyk 2014-2023</Copyright>
<Copyright>Copyright © Serhiy Perevoznyk 2014-2024</Copyright>
<Description>Belgian eID card SDK</Description>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>enginekey.snk</AssemblyOriginatorKeyFile>
Expand Down Expand Up @@ -43,4 +43,7 @@
<PackageFlatten>true</PackageFlatten>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
</ItemGroup>
</Project>

0 comments on commit 1ec3771

Please sign in to comment.