Skip to content

Commit

Permalink
ab#52646
Browse files Browse the repository at this point in the history
  • Loading branch information
leefine02 authored and leefine02 committed May 29, 2024
1 parent e2243be commit 757c39a
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 335 deletions.
3 changes: 1 addition & 2 deletions F5WafOrchestrator/CA/Discovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

namespace Keyfactor.Extensions.Orchestrator.F5WafOrchestrator.CA;

[Job("Discovery")]
public class Discovery : Job<Discovery>, IDiscoveryJobExtension
public class Discovery : Job, IDiscoveryJobExtension
{
ILogger _logger = LogHandler.GetClassLogger<Discovery>();

Expand Down
3 changes: 1 addition & 2 deletions F5WafOrchestrator/CA/Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

namespace Keyfactor.Extensions.Orchestrator.F5WafOrchestrator.CA;

[Job("Inventory")]
public class Inventory : Job<Inventory>, IInventoryJobExtension
public class Inventory : Job, IInventoryJobExtension
{
private readonly ILogger _logger = LogHandler.GetClassLogger<Inventory>();

Expand Down
3 changes: 1 addition & 2 deletions F5WafOrchestrator/CA/Management.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

namespace Keyfactor.Extensions.Orchestrator.F5WafOrchestrator.CA;

[Job("Management")]
public class Management : Job<Management>, IManagementJobExtension
public class Management : Job, IManagementJobExtension
{
ILogger _logger = LogHandler.GetClassLogger<Management>();

Expand Down
6 changes: 5 additions & 1 deletion F5WafOrchestrator/F5WafClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,11 @@ public string ExtractEndEntityandCertChain(string pfxData, string password)
string endEntityandChain = "";

byte[] pfxBytes = Convert.FromBase64String(pfxData);
Pkcs12Store store = new Pkcs12Store(new MemoryStream(pfxBytes), password.ToCharArray());

Pkcs12StoreBuilder storeBuilder = new Pkcs12StoreBuilder();
Pkcs12Store store = storeBuilder.Build();
store.Load(new MemoryStream(pfxBytes), password.ToCharArray());

foreach (string alias in store.Aliases)
{
if (store.IsKeyEntry(alias))
Expand Down
2 changes: 1 addition & 1 deletion F5WafOrchestrator/F5WafJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Keyfactor.Extensions.Orchestrator.F5WafOrchestrator;

public abstract class Job<T> : IOrchestratorJobExtension
public abstract class Job
{
protected F5WafClient F5Client { get; set; }
public string ExtensionName => "F5Waf";
Expand Down
9 changes: 8 additions & 1 deletion F5WafOrchestrator/F5WafOrchestrator.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<TargetFramework>net6.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Keyfactor.Extensions.Orchestrator.F5WafOrchestrator</RootNamespace>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.3.0" />
<PackageReference Include="Keyfactor.Logging" Version="1.1.1" />
<PackageReference Include="Keyfactor.Orchestrators.IOrchestratorJobExtensions" Version="0.7.0" />
<PackageReference Include="netvmomi.API" Version="1.0.16" />
Expand All @@ -32,11 +35,15 @@

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants></DefineConstants>
<BaseOutputPath>C:\Program Files\Keyfactor\Keyfactor Orchestrator\extensions\F5WafOrchestrator</BaseOutputPath>
<BaseOutputPath></BaseOutputPath>
<OutputPath>$(BaseOutputPath)</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>

</PropertyGroup>

<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="echo F | xcopy &quot;$(ProjectDir)manifest.json&quot; &quot;$(TargetDir)\manifest.json&quot; /Y" />
</Target>

</Project>
3 changes: 1 addition & 2 deletions F5WafOrchestrator/TLS/Discovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

namespace Keyfactor.Extensions.Orchestrator.F5WafOrchestrator.TLS;

[Job("Discovery")]
public class Discovery : Job<Discovery>, IDiscoveryJobExtension
public class Discovery : Job, IDiscoveryJobExtension
{
ILogger _logger = LogHandler.GetClassLogger<Discovery>();

Expand Down
3 changes: 1 addition & 2 deletions F5WafOrchestrator/TLS/Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

namespace Keyfactor.Extensions.Orchestrator.F5WafOrchestrator.TLS;

[Job("Inventory")]
public class Inventory : Job<Inventory>, IInventoryJobExtension
public class Inventory : Job, IInventoryJobExtension
{
private readonly ILogger _logger = LogHandler.GetClassLogger<Inventory>();

Expand Down
3 changes: 1 addition & 2 deletions F5WafOrchestrator/TLS/Management.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

namespace Keyfactor.Extensions.Orchestrator.F5WafOrchestrator.TLS;

[Job("Management")]
public class Management : Job<Management>, IManagementJobExtension
public class Management : Job, IManagementJobExtension
{
ILogger _logger = LogHandler.GetClassLogger<Management>();

Expand Down
Loading

0 comments on commit 757c39a

Please sign in to comment.