summaryrefslogtreecommitdiffstats
path: root/src/main.lib/Plugins/StorePlugins/PfxFile/PfxFileOptions.cs
blob: aed5bb260b80c54f5aea85166e5b9c92ae56e768 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using PKISharp.WACS.Plugins.Base;
using PKISharp.WACS.Plugins.Base.Options;
using PKISharp.WACS.Services;
using PKISharp.WACS.Services.Serialization;

namespace PKISharp.WACS.Plugins.StorePlugins
{
    [Plugin("2a2c576f-7637-4ade-b8db-e8613b0bb33e")]
    internal class PfxFileOptions : StorePluginOptions<PfxFile>
    {
        /// <summary>
        /// Path to the folder
        /// </summary>
        public string? Path { get; set; }

        /// <summary>
        /// PfxFile password
        /// </summary>
        public ProtectedString? PfxPassword { get; set; }

        internal const string PluginName = "PfxFile";
        public override string Name => PluginName;
        public override string Description => "PFX archive";

        /// <summary>
        /// Show details to the user
        /// </summary>
        /// <param name="input"></param>
        public override void Show(IInputService input)
        {
            base.Show(input);
            input.Show("Path", string.IsNullOrEmpty(Path) ? "[Default from settings.json]" : Path, level: 2);
            input.Show("Password", string.IsNullOrEmpty(PfxPassword?.Value) ? "[Default from settings.json]" : new string('*', PfxPassword.Value.Length), level: 2);
        }
    }
}