Table of Contents

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

certificatePath AbsolutePath

The absolute path to the certificate file to install.

storeLocation CertificateStoreLocation

The certificate store location where the certificate should be installed.

dependsOn FSharpOption<IEnumerable<Resource>>

The resources this resource depends on.

Returns

Resource

A Resource checking if the certificate is already installed and installing it if needed.

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.