EasySign BETA
Digital Signing Tool
Loading...
Searching...
No Matches
BundleCommandProvider.cs
Go to the documentation of this file.
1using System.CommandLine;
2using System.Text.Json.Serialization;
3
4using Microsoft.Extensions.Logging;
5
7
9{
10 internal class BundleCommandProvider : CommandProvider<Bundle, CommandProviderConfiguration>
11 {
12 private readonly ILogger _bundleLogger;
13
14 public BundleCommandProvider(CommandProviderConfiguration configuration, ILogger logger, ILogger bundleLogger) : base(configuration, logger)
15 {
16 _bundleLogger = bundleLogger;
17 }
18
19 protected override void InitializeBundle(string bundlePath)
20 {
21 Logger.LogInformation("Initializing bundle at {bundlePath}", bundlePath);
22 Bundle = new Bundle(bundlePath, _bundleLogger);
23 }
24
25 public override RootCommand GetRootCommand()
26 {
27 RootCommand root = new RootCommand("Easy Digital Signing Tool")
28 {
29 Add,
30 Info,
31 Sign,
32 Verify,
33 Config,
34 };
35
36 if (Configuration.Settings["selfsign.enable"])
37 {
38 root.Add(SelfSign);
39 }
40
41 if (Configuration.Settings["trust.enable"])
42 {
43 root.Add(Trust);
44 }
45
46 return root;
47 }
48 }
49
50 [JsonSourceGenerationOptions(GenerationMode = JsonSourceGenerationMode.Metadata, WriteIndented = true, DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
51 [JsonSerializable(typeof(CommandProviderConfiguration))]
52 internal partial class SourceGenerationConfigurationContext : JsonSerializerContext
53 {
54
55 }
56}
Represents a bundle that holds file hashes and signatures.
Definition Bundle.cs:22
Represents the configuration for the EasySign command provider.
Provides command definitions and handlers for the EasySign command line interface.