diff --git a/src/Sign.Cli/CodeCommand.cs b/src/Sign.Cli/CodeCommand.cs index a541d60d..cea545d2 100644 --- a/src/Sign.Cli/CodeCommand.cs +++ b/src/Sign.Cli/CodeCommand.cs @@ -31,6 +31,7 @@ internal sealed class CodeCommand : Command internal Option TimestampDigestOption { get; } = new(["--timestamp-digest", "-td"], HashAlgorithmParser.ParseHashAlgorithmName, description: Resources.TimestampDigestOptionDescription); internal Option TimestampUrlOption { get; } = new(["--timestamp-url", "-t"], ParseUrl, description: Resources.TimestampUrlOptionDescription); internal Option VerbosityOption { get; } = new(["--verbosity", "-v"], () => LogLevel.Warning, Resources.VerbosityOptionDescription); + internal Option CertificateExportOption { get; } = new(["--certificate-export-path", "-co"], Resources.CertificateExportPathOptionDescription); internal CodeCommand() : base("code", Resources.CodeCommandDescription) @@ -56,6 +57,7 @@ internal CodeCommand() AddGlobalOption(TimestampDigestOption); AddGlobalOption(MaxConcurrencyOption); AddGlobalOption(VerbosityOption); + AddGlobalOption(CertificateExportOption); } internal async Task HandleAsync(InvocationContext context, IServiceProviderFactory serviceProviderFactory, ISignatureProvider signatureProvider, string fileArgument) @@ -74,6 +76,7 @@ internal async Task HandleAsync(InvocationContext context, IServiceProviderFacto LogLevel verbosity = context.ParseResult.GetValueForOption(VerbosityOption); string? output = context.ParseResult.GetValueForOption(OutputOption); int maxConcurrency = context.ParseResult.GetValueForOption(MaxConcurrencyOption); + string? certificateExportPath = context.ParseResult.GetValueForOption(CertificateExportOption); // Make sure this is rooted if (!Path.IsPathRooted(baseDirectory.FullName)) @@ -184,7 +187,8 @@ internal async Task HandleAsync(InvocationContext context, IServiceProviderFacto timestampUrl, maxConcurrency, fileHashAlgorithmName, - timestampHashAlgorithmName); + timestampHashAlgorithmName, + certificateExportPath); } private static string ExpandFilePath(DirectoryInfo baseDirectory, string file) diff --git a/src/Sign.Cli/Resources.Designer.cs b/src/Sign.Cli/Resources.Designer.cs index a6ca049b..724b6031 100644 --- a/src/Sign.Cli/Resources.Designer.cs +++ b/src/Sign.Cli/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -87,6 +87,15 @@ internal static string CertificateStoreCommandDescription { } } + /// + /// Looks up a localized string similar to Path to export the signing certificate to.. + /// + internal static string CertificateExportPathOptionDescription { + get { + return ResourceManager.GetString("CertificateExportPathOptionDescription", resourceCulture); + } + } + /// /// Looks up a localized string similar to Client ID to authenticate to Azure.. /// diff --git a/src/Sign.Cli/Resources.resx b/src/Sign.Cli/Resources.resx index db7e72d3..44d53743 100644 --- a/src/Sign.Cli/Resources.resx +++ b/src/Sign.Cli/Resources.resx @@ -1,4 +1,4 @@ - +