Skip to content

Commit

Permalink
Simplified factories (#97)
Browse files Browse the repository at this point in the history
*Pkcs11Factories renamed to *Pkcs11InteropFactories
  • Loading branch information
jariq committed Jan 9, 2019
1 parent 508ce22 commit 85e2a92
Show file tree
Hide file tree
Showing 72 changed files with 150 additions and 266 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop.Mock\HighLevelAPI\IMockSlot.cs">
<Link>HighLevelAPI\IMockSlot.cs</Link>
</Compile>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop.Mock\HighLevelAPI\MockPkcs11Factories.cs">
<Link>HighLevelAPI\MockPkcs11Factories.cs</Link>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop.Mock\HighLevelAPI\MockPkcs11InteropFactories.cs">
<Link>HighLevelAPI\MockPkcs11InteropFactories.cs</Link>
</Compile>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop.Mock\LowLevelAPI40\MockDelegates.cs">
<Link>LowLevelAPI40\MockDelegates.cs</Link>
Expand Down
4 changes: 2 additions & 2 deletions src/Pkcs11Interop.Android/Pkcs11Interop/Pkcs11Interop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1384,8 +1384,8 @@
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop\HighLevelAPI\MechanismParams\IMechanismParams.cs">
<Link>HighLevelAPI\MechanismParams\IMechanismParams.cs</Link>
</Compile>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop\HighLevelAPI\Pkcs11Factories.cs">
<Link>HighLevelAPI\Pkcs11Factories.cs</Link>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop\HighLevelAPI\Pkcs11InteropFactories.cs">
<Link>HighLevelAPI\Pkcs11InteropFactories.cs</Link>
</Compile>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop\HighLevelAPI\Pkcs11UriUtils.cs">
<Link>HighLevelAPI\Pkcs11UriUtils.cs</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop.Mock\HighLevelAPI\IMockSlot.cs">
<Link>HighLevelAPI\IMockSlot.cs</Link>
</Compile>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop.Mock\HighLevelAPI\MockPkcs11Factories.cs">
<Link>HighLevelAPI\MockPkcs11Factories.cs</Link>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop.Mock\HighLevelAPI\MockPkcs11InteropFactories.cs">
<Link>HighLevelAPI\MockPkcs11InteropFactories.cs</Link>
</Compile>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop.Mock\LowLevelAPI40\MockDelegates.cs">
<Link>LowLevelAPI40\MockDelegates.cs</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1373,8 +1373,8 @@
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop\HighLevelAPI\MechanismParams\IMechanismParams.cs">
<Link>HighLevelAPI\MechanismParams\IMechanismParams.cs</Link>
</Compile>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop\HighLevelAPI\Pkcs11Factories.cs">
<Link>HighLevelAPI\Pkcs11Factories.cs</Link>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop\HighLevelAPI\Pkcs11InteropFactories.cs">
<Link>HighLevelAPI\Pkcs11InteropFactories.cs</Link>
</Compile>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop\HighLevelAPI\Pkcs11UriUtils.cs">
<Link>HighLevelAPI\Pkcs11UriUtils.cs</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop.Mock\HighLevelAPI\IMockSlot.cs">
<Link>HighLevelAPI\IMockSlot.cs</Link>
</Compile>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop.Mock\HighLevelAPI\MockPkcs11Factories.cs">
<Link>HighLevelAPI\MockPkcs11Factories.cs</Link>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop.Mock\HighLevelAPI\MockPkcs11InteropFactories.cs">
<Link>HighLevelAPI\MockPkcs11InteropFactories.cs</Link>
</Compile>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop.Mock\LowLevelAPI40\MockDelegates.cs">
<Link>LowLevelAPI40\MockDelegates.cs</Link>
Expand Down
4 changes: 2 additions & 2 deletions src/Pkcs11Interop.iOS/Pkcs11Interop/Pkcs11Interop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1381,8 +1381,8 @@
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop\HighLevelAPI\MechanismParams\IMechanismParams.cs">
<Link>HighLevelAPI\MechanismParams\IMechanismParams.cs</Link>
</Compile>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop\HighLevelAPI\Pkcs11Factories.cs">
<Link>HighLevelAPI\Pkcs11Factories.cs</Link>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop\HighLevelAPI\Pkcs11InteropFactories.cs">
<Link>HighLevelAPI\Pkcs11InteropFactories.cs</Link>
</Compile>
<Compile Include="..\..\Pkcs11Interop\Pkcs11Interop\HighLevelAPI\Pkcs11UriUtils.cs">
<Link>HighLevelAPI\Pkcs11UriUtils.cs</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public MockPkcs11Factory()
/// <param name="libraryPath">Library name or path</param>
/// <param name="appType">Type of application that will be using PKCS#11 library</param>
/// <returns>High level PKCS#11 wrapper</returns>
public IPkcs11 CreatePkcs11(Pkcs11Factories factories, string libraryPath, AppType appType)
public IPkcs11 CreatePkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType)
{
return _factory.CreatePkcs11(factories, libraryPath, appType);
}
Expand All @@ -78,7 +78,7 @@ public IPkcs11 CreatePkcs11(Pkcs11Factories factories, string libraryPath, AppTy
/// <param name="appType">Type of application that will be using PKCS#11 library</param>
/// <param name="initType">Source of PKCS#11 function pointers</param>
/// <returns>High level PKCS#11 wrapper</returns>
public IPkcs11 CreatePkcs11(Pkcs11Factories factories, string libraryPath, AppType appType, InitType initType)
public IPkcs11 CreatePkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType, InitType initType)
{
return _factory.CreatePkcs11(factories, libraryPath, appType, initType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public MockSessionFactory()
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="pkcs11">Low level PKCS#11 wrapper</param>
/// <param name="sessionId">PKCS#11 handle of session</param>
public ISession CreateSession(Pkcs11Factories factories, LowLevelPkcs11 pkcs11, ulong sessionId)
public ISession CreateSession(Pkcs11InteropFactories factories, LowLevelPkcs11 pkcs11, ulong sessionId)
{
return _factory.CreateSession(factories, pkcs11, sessionId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public MockSlotFactory()
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="pkcs11">Low level PKCS#11 wrapper</param>
/// <param name="slotId">PKCS#11 handle of slot</param>
public ISlot CreateSlot(Pkcs11Factories factories, LowLevelPkcs11 pkcs11, ulong slotId)
public ISlot CreateSlot(Pkcs11InteropFactories factories, LowLevelPkcs11 pkcs11, ulong slotId)
{
return _factory.CreateSlot(factories, pkcs11, slotId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ namespace Net.Pkcs11Interop.Mock.HighLevelAPI
/// <summary>
/// PKCS11-MOCK specific factories used by Pkcs11Interop library
/// </summary>
public class MockPkcs11Factories : Pkcs11Factories
public class MockPkcs11InteropFactories : Pkcs11InteropFactories
{
/// <summary>
/// Initializes new instance of MockPkcs11Factories class
/// Initializes new instance of MockPkcs11InteropFactories class
/// </summary>
public MockPkcs11Factories()
public MockPkcs11InteropFactories()
{
_pkcs11Factory = new MockPkcs11Factory();
_slotFactory = new MockSlotFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class MockPkcs11Factory : IPkcs11Factory
/// <param name="libraryPath">Library name or path</param>
/// <param name="appType">Type of application that will be using PKCS#11 library</param>
/// <returns>High level PKCS#11 wrapper</returns>
public IPkcs11 CreatePkcs11(Pkcs11Factories factories, string libraryPath, AppType appType)
public IPkcs11 CreatePkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType)
{
return new MockPkcs11(factories, libraryPath, appType);
}
Expand All @@ -52,7 +52,7 @@ public IPkcs11 CreatePkcs11(Pkcs11Factories factories, string libraryPath, AppTy
/// <param name="appType">Type of application that will be using PKCS#11 library</param>
/// <param name="initType">Source of PKCS#11 function pointers</param>
/// <returns>High level PKCS#11 wrapper</returns>
public IPkcs11 CreatePkcs11(Pkcs11Factories factories, string libraryPath, AppType appType, InitType initType)
public IPkcs11 CreatePkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType, InitType initType)
{
return new MockPkcs11(factories, libraryPath, appType, initType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class MockSessionFactory : ISessionFactory
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="pkcs11">Low level PKCS#11 wrapper</param>
/// <param name="sessionId">PKCS#11 handle of session</param>
public ISession CreateSession(Pkcs11Factories factories, LowLevelPkcs11 pkcs11, ulong sessionId)
public ISession CreateSession(Pkcs11InteropFactories factories, LowLevelPkcs11 pkcs11, ulong sessionId)
{
LowLevelAPI40.MockPkcs11 p11 = pkcs11 as LowLevelAPI40.MockPkcs11;
if (p11 == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class MockSlotFactory : ISlotFactory
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="pkcs11">Low level PKCS#11 wrapper</param>
/// <param name="slotId">PKCS#11 handle of slot</param>
public ISlot CreateSlot(Pkcs11Factories factories, LowLevelPkcs11 pkcs11, ulong slotId)
public ISlot CreateSlot(Pkcs11InteropFactories factories, LowLevelPkcs11 pkcs11, ulong slotId)
{
LowLevelAPI40.MockPkcs11 p11 = pkcs11 as LowLevelAPI40.MockPkcs11;
if (p11 == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class MockPkcs11 : Net.Pkcs11Interop.HighLevelAPI40.Pkcs11, IMockPkcs11
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="libraryPath">Library name or path</param>
/// <param name="appType">Type of application that will be using PKCS#11 library</param>
public MockPkcs11(Pkcs11Factories factories, string libraryPath, AppType appType)
public MockPkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType)
: base(factories, libraryPath)
{
_logger.Debug("MockPkcs11({0})::ctor1", _libraryPath);
Expand Down Expand Up @@ -77,7 +77,7 @@ public MockPkcs11(Pkcs11Factories factories, string libraryPath, AppType appType
/// <param name="libraryPath">Library name or path</param>
/// <param name="appType">Type of application that will be using PKCS#11 library</param>
/// <param name="initType">Source of PKCS#11 function pointers</param>
public MockPkcs11(Pkcs11Factories factories, string libraryPath, AppType appType, InitType initType)
public MockPkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType, InitType initType)
: base(factories, libraryPath)
{
_logger.Debug("MockPkcs11({0})::ctor2", _libraryPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class MockSession : Net.Pkcs11Interop.HighLevelAPI40.Session, IMockSessio
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="pkcs11">Low level PKCS#11 wrapper</param>
/// <param name="sessionId">PKCS#11 handle of session</param>
internal MockSession(Pkcs11Factories factories, LowLevelAPI40.MockPkcs11 pkcs11, ulong sessionId)
internal MockSession(Pkcs11InteropFactories factories, LowLevelAPI40.MockPkcs11 pkcs11, ulong sessionId)
: base(factories, pkcs11, sessionId)
{
_logger.Debug("MockSession({0})::ctor", _sessionId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class MockSlot : Net.Pkcs11Interop.HighLevelAPI40.Slot, IMockSlot
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="pkcs11">Low level PKCS#11 wrapper</param>
/// <param name="slotId">PKCS#11 handle of slot</param>
internal MockSlot(Pkcs11Factories factories, LowLevelAPI40.MockPkcs11 pkcs11, ulong slotId)
internal MockSlot(Pkcs11InteropFactories factories, LowLevelAPI40.MockPkcs11 pkcs11, ulong slotId)
: base(factories, pkcs11, slotId)
{
_logger.Debug("MockSlot({0})::ctor", _slotId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class MockPkcs11Factory : IPkcs11Factory
/// <param name="libraryPath">Library name or path</param>
/// <param name="appType">Type of application that will be using PKCS#11 library</param>
/// <returns>High level PKCS#11 wrapper</returns>
public IPkcs11 CreatePkcs11(Pkcs11Factories factories, string libraryPath, AppType appType)
public IPkcs11 CreatePkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType)
{
return new MockPkcs11(factories, libraryPath, appType);
}
Expand All @@ -52,7 +52,7 @@ public IPkcs11 CreatePkcs11(Pkcs11Factories factories, string libraryPath, AppTy
/// <param name="appType">Type of application that will be using PKCS#11 library</param>
/// <param name="initType">Source of PKCS#11 function pointers</param>
/// <returns>High level PKCS#11 wrapper</returns>
public IPkcs11 CreatePkcs11(Pkcs11Factories factories, string libraryPath, AppType appType, InitType initType)
public IPkcs11 CreatePkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType, InitType initType)
{
return new MockPkcs11(factories, libraryPath, appType, initType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class MockSessionFactory : ISessionFactory
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="pkcs11">Low level PKCS#11 wrapper</param>
/// <param name="sessionId">PKCS#11 handle of session</param>
public ISession CreateSession(Pkcs11Factories factories, LowLevelPkcs11 pkcs11, ulong sessionId)
public ISession CreateSession(Pkcs11InteropFactories factories, LowLevelPkcs11 pkcs11, ulong sessionId)
{
LowLevelAPI41.MockPkcs11 p11 = pkcs11 as LowLevelAPI41.MockPkcs11;
if (p11 == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class MockSlotFactory : ISlotFactory
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="pkcs11">Low level PKCS#11 wrapper</param>
/// <param name="slotId">PKCS#11 handle of slot</param>
public ISlot CreateSlot(Pkcs11Factories factories, LowLevelPkcs11 pkcs11, ulong slotId)
public ISlot CreateSlot(Pkcs11InteropFactories factories, LowLevelPkcs11 pkcs11, ulong slotId)
{
LowLevelAPI41.MockPkcs11 p11 = pkcs11 as LowLevelAPI41.MockPkcs11;
if (p11 == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class MockPkcs11 : Net.Pkcs11Interop.HighLevelAPI41.Pkcs11, IMockPkcs11
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="libraryPath">Library name or path</param>
/// <param name="appType">Type of application that will be using PKCS#11 library</param>
public MockPkcs11(Pkcs11Factories factories, string libraryPath, AppType appType)
public MockPkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType)
: base(factories, libraryPath)
{
_logger.Debug("MockPkcs11({0})::ctor1", _libraryPath);
Expand Down Expand Up @@ -77,7 +77,7 @@ public MockPkcs11(Pkcs11Factories factories, string libraryPath, AppType appType
/// <param name="libraryPath">Library name or path</param>
/// <param name="appType">Type of application that will be using PKCS#11 library</param>
/// <param name="initType">Source of PKCS#11 function pointers</param>
public MockPkcs11(Pkcs11Factories factories, string libraryPath, AppType appType, InitType initType)
public MockPkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType, InitType initType)
: base(factories, libraryPath)
{
_logger.Debug("MockPkcs11({0})::ctor2", _libraryPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class MockSession : Net.Pkcs11Interop.HighLevelAPI41.Session, IMockSessio
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="pkcs11">Low level PKCS#11 wrapper</param>
/// <param name="sessionId">PKCS#11 handle of session</param>
internal MockSession(Pkcs11Factories factories, LowLevelAPI41.MockPkcs11 pkcs11, ulong sessionId)
internal MockSession(Pkcs11InteropFactories factories, LowLevelAPI41.MockPkcs11 pkcs11, ulong sessionId)
: base(factories, pkcs11, sessionId)
{
_logger.Debug("MockSession({0})::ctor", _sessionId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class MockSlot : Net.Pkcs11Interop.HighLevelAPI41.Slot, IMockSlot
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="pkcs11">Low level PKCS#11 wrapper</param>
/// <param name="slotId">PKCS#11 handle of slot</param>
internal MockSlot(Pkcs11Factories factories, LowLevelAPI41.MockPkcs11 pkcs11, ulong slotId)
internal MockSlot(Pkcs11InteropFactories factories, LowLevelAPI41.MockPkcs11 pkcs11, ulong slotId)
: base(factories, pkcs11, slotId)
{
_logger.Debug("MockSlot({0})::ctor", _slotId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class MockPkcs11Factory : IPkcs11Factory
/// <param name="libraryPath">Library name or path</param>
/// <param name="appType">Type of application that will be using PKCS#11 library</param>
/// <returns>High level PKCS#11 wrapper</returns>
public IPkcs11 CreatePkcs11(Pkcs11Factories factories, string libraryPath, AppType appType)
public IPkcs11 CreatePkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType)
{
return new MockPkcs11(factories, libraryPath, appType);
}
Expand All @@ -52,7 +52,7 @@ public IPkcs11 CreatePkcs11(Pkcs11Factories factories, string libraryPath, AppTy
/// <param name="appType">Type of application that will be using PKCS#11 library</param>
/// <param name="initType">Source of PKCS#11 function pointers</param>
/// <returns>High level PKCS#11 wrapper</returns>
public IPkcs11 CreatePkcs11(Pkcs11Factories factories, string libraryPath, AppType appType, InitType initType)
public IPkcs11 CreatePkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType, InitType initType)
{
return new MockPkcs11(factories, libraryPath, appType, initType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class MockSessionFactory : ISessionFactory
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="pkcs11">Low level PKCS#11 wrapper</param>
/// <param name="sessionId">PKCS#11 handle of session</param>
public ISession CreateSession(Pkcs11Factories factories, LowLevelPkcs11 pkcs11, ulong sessionId)
public ISession CreateSession(Pkcs11InteropFactories factories, LowLevelPkcs11 pkcs11, ulong sessionId)
{
LowLevelAPI80.MockPkcs11 p11 = pkcs11 as LowLevelAPI80.MockPkcs11;
if (p11 == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class MockSlotFactory : ISlotFactory
/// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
/// <param name="pkcs11">Low level PKCS#11 wrapper</param>
/// <param name="slotId">PKCS#11 handle of slot</param>
public ISlot CreateSlot(Pkcs11Factories factories, LowLevelPkcs11 pkcs11, ulong slotId)
public ISlot CreateSlot(Pkcs11InteropFactories factories, LowLevelPkcs11 pkcs11, ulong slotId)
{
LowLevelAPI80.MockPkcs11 p11 = pkcs11 as LowLevelAPI80.MockPkcs11;
if (p11 == null)
Expand Down
Loading

0 comments on commit 85e2a92

Please sign in to comment.