Class WindowsCertificates
- Namespace
- Fabricator.Resources
- Assembly
- Fabricator.Resources.dll
[CompilationMapping(SourceConstructFlags.ObjectType)]
public class WindowsCertificates
- Inheritance
-
WindowsCertificates
- Inherited Members
Methods
trustedCertificate(AbsolutePath, CertificateStoreLocation, FSharpOption<IEnumerable<Resource>>?)
Creates a resource that ensures a certificate is installed in the specified certificate store. This is a pure .NET implementation equivalent to PowerShell's Import-Certificate command.
public static Resource trustedCertificate(AbsolutePath certificatePath, CertificateStoreLocation storeLocation, FSharpOption<IEnumerable<Resource>>? dependsOn)
Parameters
certificatePathAbsolutePathThe absolute path to the certificate file to install.
storeLocationCertificateStoreLocationThe certificate store location where the certificate should be installed.
dependsOnFSharpOption<IEnumerable<Resource>>The resources this resource depends on.
Returns
Examples
Install a certificate to the Local Machine Root store:
let certResource = trustedCertificate(AbsolutePath @"C:\certs\mycert.cer", CertificateStores.LocalMachineTrustedRootCertificationAuthorities)
Remarks
This feature is Windows-only. On other platforms, certificate management varies significantly. The resource identifies certificates by their thumbprint, so if a certificate with the same thumbprint already exists in the store, it will be considered already applied.