1
0
Fork 0
mirror of https://github.com/win-acme/win-acme.git synced 2026-04-27 03:55:56 +03:00
2 Custom plugins
Wouter Tinus edited this page 2019-01-21 22:31:13 +01:00

Custom plugins

General architecture

A plugin generally exists of at least three classes

  • The plugin itself that executes the logic to its job, usually implementing a specific interface
  • The options class (inheriting from PluginOptions) that holds all the information required to execute the plugin in the context of a specific renewal. It should be decorated with [Plugin("{GUID}")] as a unique identifier.
  • The options factory class (implementing IPluginOptionsFactory) that gathers the options from the command line and/or from interaction with the user

Often two more classes are added

  • A arguments class that holds command line arguments that users can provide to the plugin
  • An arguments provider class that implements IArgumentsProvider describes and validates those arguments

Target

Purpose: generate a Target (list of domain names and common name to generate a certificate for). Starting points to inherit from:

  • TPlugin: ITargetPlugin instance of TOptions can be provided to the constructor via DI
  • TOptions: TargetPluginOptions<TPlugin>
  • TOptionsFactory: TargetPluginOptionsFactory<TPlugin, TOptions>

Validation

Purpose: validate a single identifier included in the target. Starting points to inherit from:

  • VPlugin: Validation<VOptions, Http01ChallengeValidationDetails>
  • VOptions: ValidationPluginOptions<VPlugin>
  • VOptionsFactory: ValidationPluginOptionsFactory<VPlugin, VOptions>

CSR

Purpose: generate CSR.

  • CPlugin: CsrPlugin<CPlugin, COptions>
  • COptions: CsrPluginOptions<CPlugin>
  • COptionsFactory: CsrPluginOptionsFactory<CPlugin, COptions>

Store

Purpose: place the requested certificate somewhere it can be used by applications.

  • SPlugin: IStorePlugin
  • SOptions: StorePluginOptions<SPlugin>
  • SOptionsFactory: StorePluginOptionsFactory<SPlugin, SOptions>

Installation

Purpose: configure an application to use the new certificate.

  • IPlugin: IInstallationPlugin
  • IOptions: InstallationPluginOptions<IPlugin>
  • IOptionsFactory: InstallationPluginFactory<IPlugin, IOptions>