-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
427 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...Calamari.FullFrameworkTools/WindowsCertStore/Contracts/AddPrivateKeyAccessRulesRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#nullable enable | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Security.Cryptography.X509Certificates; | ||
using Calamari.FullFrameworkTools.Command; | ||
|
||
namespace Calamari.FullFrameworkTools.WindowsCertStore.Contracts; | ||
|
||
public class AddPrivateKeyAccessRulesRequest : IRequest | ||
{ | ||
public AddPrivateKeyAccessRulesRequest(string thumbprint, StoreLocation storeLocation, string storeName, List<PrivateKeyAccessRule> privateKeyAccessRules) | ||
{ | ||
this.Thumbprint = thumbprint; | ||
StoreName = storeName; | ||
PrivateKeyAccessRules = privateKeyAccessRules; | ||
StoreLocation = storeLocation; | ||
} | ||
|
||
public string Thumbprint { get; set; } | ||
public StoreLocation StoreLocation { get; set; } | ||
public string StoreName { get; set; } | ||
public List<PrivateKeyAccessRule> PrivateKeyAccessRules { get; set; } | ||
|
||
|
||
public VoidResponse DoIt(IWindowsX509CertificateStore certificateStore) | ||
{ | ||
if (string.IsNullOrEmpty(StoreName)) | ||
{ | ||
certificateStore.AddPrivateKeyAccessRules(Thumbprint, StoreLocation, PrivateKeyAccessRules); | ||
} | ||
else | ||
{ | ||
certificateStore.AddPrivateKeyAccessRules(Thumbprint, StoreLocation, StoreName, PrivateKeyAccessRules); | ||
} | ||
|
||
return new VoidResponse(); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
source/Calamari.FullFrameworkTools/WindowsCertStore/Contracts/FindCertificateStoreRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#nullable enable | ||
using System; | ||
using System.Security.Cryptography.X509Certificates; | ||
using Calamari.FullFrameworkTools.Command; | ||
|
||
namespace Calamari.FullFrameworkTools.WindowsCertStore.Contracts; | ||
|
||
public class FindCertificateStoreRequest : IRequest | ||
{ | ||
public FindCertificateStoreRequest(string thumbprint, StoreLocation storeLocation) | ||
{ | ||
Thumbprint = thumbprint; | ||
StoreLocation = storeLocation; | ||
} | ||
|
||
public string Thumbprint { get; } | ||
public StoreLocation StoreLocation { get; } | ||
|
||
public VoidResponse DoIt(IWindowsX509CertificateStore certificateStore) | ||
{ | ||
certificateStore.FindCertificateStore(Thumbprint, StoreLocation); | ||
return new VoidResponse(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...ullFrameworkTools/WindowsCertStore/Contracts/ImportCertificateToStoreByLocationRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#nullable enable | ||
using System; | ||
using System.Security.Cryptography.X509Certificates; | ||
using Calamari.FullFrameworkTools.Command; | ||
|
||
namespace Calamari.FullFrameworkTools.WindowsCertStore.Contracts; | ||
|
||
public class ImportCertificateToStoreByLocationRequest : IRequest | ||
{ | ||
public ImportCertificateToStoreByLocationRequest(byte[] pfxBytes, string password, StoreLocation storeLocation,string storeName, bool privateKeyExportable) | ||
{ | ||
PfxBytes = pfxBytes; | ||
Password = password; | ||
StoreLocation = storeLocation; | ||
StoreName = storeName; | ||
PrivateKeyExportable = privateKeyExportable; | ||
} | ||
|
||
public byte[] PfxBytes { get; set; } | ||
public string Password { get; set; } | ||
public StoreLocation StoreLocation { get; set; } | ||
public string StoreName { get; set; } | ||
public bool PrivateKeyExportable { get; set; } | ||
|
||
public VoidResponse DoIt(IWindowsX509CertificateStore certificateStore) | ||
{ | ||
certificateStore.ImportCertificateToStore(PfxBytes, Password, StoreLocation, StoreName, PrivateKeyExportable); | ||
return new VoidResponse(); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...ri.FullFrameworkTools/WindowsCertStore/Contracts/ImportCertificateToStoreByUserRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#nullable enable | ||
using System; | ||
using Calamari.FullFrameworkTools.Command; | ||
|
||
namespace Calamari.FullFrameworkTools.WindowsCertStore.Contracts; | ||
|
||
public class ImportCertificateToStoreByUserRequest : IRequest | ||
{ | ||
public ImportCertificateToStoreByUserRequest(byte[] pfxBytes, string password, string userName, string storeName, bool privateKeyExportable) | ||
{ | ||
PfxBytes = pfxBytes; | ||
Password = password; | ||
UserName = userName; | ||
StoreName = storeName; | ||
PrivateKeyExportable = privateKeyExportable; | ||
} | ||
|
||
public byte[] PfxBytes { get; set; } | ||
public string Password { get; set; } | ||
public string UserName { get; set; } | ||
public string StoreName { get; set; } | ||
public bool PrivateKeyExportable { get; set; } | ||
|
||
public VoidResponse DoIt(IWindowsX509CertificateStore certificateStore) | ||
{ | ||
certificateStore.ImportCertificateToStore(PfxBytes, Password, UserName, StoreName, PrivateKeyExportable); | ||
return new VoidResponse(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...e/Calamari.FullFrameworkTools/WindowsCertStore/Contracts/OverwriteHomeDirectoryRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#nullable enable | ||
using System; | ||
using Calamari.FullFrameworkTools.Command; | ||
using Calamari.FullFrameworkTools.Iis; | ||
|
||
namespace Calamari.FullFrameworkTools.WindowsCertStore.Contracts; | ||
|
||
public class OverwriteHomeDirectoryRequest : IRequest | ||
{ | ||
public OverwriteHomeDirectoryRequest(string iisWebSiteName, string path, bool legacySupport) | ||
{ | ||
IisWebSiteName = iisWebSiteName; | ||
Path = path; | ||
LegacySupport = legacySupport; | ||
} | ||
|
||
public string IisWebSiteName { get; set; } | ||
public string Path { get; set; } | ||
public bool LegacySupport { get; set; } | ||
|
||
public BoolResponse DoIt(IInternetInformationServer certificateStore) | ||
{ | ||
certificateStore.OverwriteHomeDirectory(IisWebSiteName, Path, LegacySupport); | ||
return new BoolResponse(); | ||
} | ||
} |
Oops, something went wrong.