Skip to content

Commit 1d87b10

Browse files
author
Lee Fine
committed
1 parent f9dc1ab commit 1d87b10

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

RemoteFile.UnitTests/RemoteFile.UnitTests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
<ItemGroup>
1212
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" />
13+
<PackageReference Include="Keyfactor.Orchestrators.IOrchestratorJobExtensions" Version="1.0.0" />
1314
<PackageReference Include="Keyfactor.PKI" Version="8.1.1" />
1415
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
1516
<PackageReference Include="xunit" Version="2.4.1" />

RemoteFile/ReenrollmentBase.cs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using Keyfactor.Orchestrators.Common.Enums;
1414

1515
using Microsoft.Extensions.Logging;
16+
using static Keyfactor.PKI.PKIConstants.X509;
1617

1718
namespace Keyfactor.Extensions.Orchestrator.RemoteFile
1819
{
@@ -47,9 +48,22 @@ public JobResult ProcessJobToDo(ReenrollmentJobConfiguration config, SubmitReenr
4748
{
4849
SetJobProperties(config, config.CertificateStoreDetails, logger);
4950

50-
string alias = config.;
51-
string sans = "reenroll2.Keyfactor.com&reenroll1.keyfactor.com&reenroll3.Keyfactor.com";
52-
bool overwrite = true;
51+
bool overwrite = config.Overwrite;
52+
string alias = config.Alias;
53+
string sans = "";
54+
if (config.SANs.Count > 0)
55+
{
56+
foreach (KeyValuePair<string, string[]> keyValue in config.SANs)
57+
{
58+
string key = keyValue.Key.Replace("ip4", "ip", StringComparison.OrdinalIgnoreCase).Replace("ip6", "ip", StringComparison.OrdinalIgnoreCase).Replace("upn", "uri", StringComparison.OrdinalIgnoreCase);
59+
foreach (string value in keyValue.Value)
60+
{
61+
sans += (key + ":" + value + ",");
62+
}
63+
}
64+
if (sans.Length > 0)
65+
sans = sans.Substring(0, sans.Length - 1);
66+
}
5367

5468
// validate parameters
5569
string KeyTypes = string.Join(",", Enum.GetNames(typeof(SupportedKeyTypeEnum)));
@@ -58,9 +72,7 @@ public JobResult ProcessJobToDo(ReenrollmentJobConfiguration config, SubmitReenr
5872
throw new RemoteFileException($"Unsupported KeyType value {KeyType}. Supported types are {KeyTypes}.");
5973
}
6074

61-
ApplicationSettings.FileTransferProtocolEnum fileTransferProtocol = ApplicationSettings.FileTransferProtocol;
62-
63-
certificateStore = new RemoteCertificateStore(config.CertificateStoreDetails.ClientMachine, UserName, UserPassword, config.CertificateStoreDetails.StorePath, StorePassword, fileTransferProtocol, SSHPort, IncludePortInSPN);
75+
certificateStore = new RemoteCertificateStore(config.CertificateStoreDetails.ClientMachine, UserName, UserPassword, config.CertificateStoreDetails.StorePath, StorePassword, SSHPort, IncludePortInSPN);
6476
certificateStore.Initialize(SudoImpersonatedUser, UseShellCommands);
6577

6678
PathFile storePathFile = RemoteCertificateStore.SplitStorePathFile(config.CertificateStoreDetails.StorePath);

RemoteFile/RemoteFile.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<ItemGroup>
1111
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" />
1212
<PackageReference Include="CliWrap" Version="3.6.6" />
13-
<PackageReference Include="Keyfactor.Orchestrators.IOrchestratorJobExtensions" Version="0.7.0" />
13+
<PackageReference Include="Keyfactor.Orchestrators.IOrchestratorJobExtensions" Version="1.0.0" />
1414
<PackageReference Include="Keyfactor.PKI" Version="8.1.1" />
1515
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.5" />
1616
<PackageReference Include="SSH.NET" Version="2024.0.0" />

0 commit comments

Comments
 (0)