-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for optional Azure Key Vault certificate version selection #268
Merged
vcsjones
merged 3 commits into
vcsjones:main
from
ConcernedCitizen:cert-version-selection
Sep 16, 2024
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,7 @@ internal sealed class SignCommand : Command | |
internal string? KeyVaultClientSecret { get; set; } | ||
internal string? KeyVaultTenantId { get; set; } | ||
internal string? KeyVaultCertificate { get; set; } | ||
internal string? KeyVaultCertificateVersion { get; set; } | ||
internal string? KeyVaultAccessToken { get; set; } | ||
internal bool UseManagedIdentity { get; set; } | ||
internal string? SignDescription { get; set; } | ||
|
@@ -150,16 +151,17 @@ public SignCommand() : base("sign", "Sign a file.", null) | |
this.Add("kvs|azure-key-vault-client-secret=", "The Client Secret to authenticate to the Azure Key Vault.", v => KeyVaultClientSecret = v); | ||
this.Add("kvt|azure-key-vault-tenant-id=", "The Tenant Id to authenticate to the Azure Key Vault.", v => KeyVaultTenantId = v); | ||
this.Add("kvc|azure-key-vault-certificate=", "The name of the certificate in Azure Key Vault.", v => KeyVaultCertificate = v); | ||
this.Add("kvcv|azure-key-vault-certificate-version=", "The version of the certificate in Azure Key Vault to use. The current version of the certificate is used by default.", v => KeyVaultCertificateVersion = v); | ||
this.Add("kva|azure-key-vault-accesstoken=", "The Access Token to authenticate to the Azure Key Vault.", v => KeyVaultAccessToken = v); | ||
this.Add("kvm|azure-key-vault-managed-identity", "Use the current Azure mananaged identity.", v => UseManagedIdentity = v is not null); | ||
this.Add("kvm|azure-key-vault-managed-identity", "Use the current Azure managed identity.", v => UseManagedIdentity = v is not null); | ||
this.Add("d|description=", "Provide a description of the signed content.", v => SignDescription = v); | ||
this.Add("du|description-url=", "Provide a URL with more information about the signed content.", v => SignDescriptionUrl = v); | ||
this.Add("tr|timestamp-rfc3161=", "Specifies the RFC 3161 timestamp server's URL. If this option (or -t) is not specified, the signed file will not be timestamped.", v => Rfc3161TimestampUrl = v); | ||
this.Add("td|timestamp-digest=", "Used with the -tr switch to request a digest algorithm used by the RFC 3161 timestamp server.", v => TimestampDigestAlgorithm = v); | ||
this.Add("fd|file-digest=", "The digest algorithm to hash the file with.", v => FileDigestAlgorithm = v); | ||
this.Add("t|timestamp-authenticode=", "Specify the legacy timestamp server's URL. This option is generally not recommended. Use the --timestamp-rfc3161 option instead.", v => AuthenticodeTimestampUrl = v); | ||
this.Add("ac|additional-certificates=", "Specify one or more certificates to include in the public certificate chain.", AdditionalCertificates); | ||
this.Add("v|verbose", "Specify one or more certificates to include in the public certificate chain.", v => Verbose = v is not null); | ||
this.Add("v|verbose", "Include additional output in the log. This parameter does not accept a value and cannot be combine with the --quiet option.", v => Verbose = v is not null); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ohh extra thank you. |
||
this.Add("q|quiet", "Do not print any output to the console.", v => Quiet = v is not null); | ||
this.Add("ph|page-hashing", "Generate page hashes for executable files if supported.", v => PageHashing = v is not null); | ||
this.Add("nph|no-page-hashing", "Suppress page hashes for executable files if supported.", v => NoPageHashing = v is not null); | ||
|
@@ -212,6 +214,7 @@ private async ValueTask<int> RunSign() | |
{ | ||
AzureKeyVaultUrl = new Uri(KeyVaultUrl!), | ||
AzureKeyVaultCertificateName = KeyVaultCertificate, | ||
AzureKeyVaultCertificateVersion = KeyVaultCertificateVersion, | ||
AzureClientId = KeyVaultClientId, | ||
AzureTenantId = KeyVaultTenantId, | ||
AzureAccessToken = KeyVaultAccessToken, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!