Skip to content
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

Add command to download/export certificates from Trusted Signing #732

Closed
wants to merge 3 commits into from

Conversation

mjcheetham
Copy link

@mjcheetham mjcheetham commented Jun 26, 2024

Add a new command export to the CLI that allows users to export a certificate (the public parts) from, initially, just the Trusted Signing service to a file on disk. This is particularly useful for users who need a copy of the latest Trusted Signing certificate to upload to a third-party service such as NuGet.org to allow verification of the signed packages that are published there.

This pull request is organised in three commits that can be reviewed individually and are as follows:

  1. Extract a base class from the TrustedSigningCommand to allow sharing of options for Trusted Signing account info.

  2. Add (I)Exporter that can export a certificate to a file on disk from a certificate provider.

  3. Add an implementation for the export certificate command for Trusted Signing.

Open questions

  • In this implementation, the export command is separate from the code(sign) process, meaning the actual certificate downloaded may end up being different from the one used to sign if the service has rotated certificates in the gap between. Should we consider adding a flag to the code command to allow exporting the certificate at the same time as signing? (see alternative implementations below!!)

  • Should we consider adding a --force flag to the export command to overwrite the file if it already exists?

  • Should we consider adding a --format flag to the export command to allow exporting the certificate in different formats (e.g. PEM, DER, etc)?

  • Does this make sense for other services that provide certificates, or is this only applicable to Trusted Signing?

Alternative implementations

Extract a base class from the `TrustedSigningCommand` so in future
commits we can share the options for the account, endpoint, etc
between other Trusted Signing commands.
Add new 'export' component that can export a certificate to a file on
disk from a certificate provider.
Add an implementation for the export certificate command for Trusted
Signing.
@mjcheetham mjcheetham changed the title Add ability to download/export certificates from Trusted Signing Add command to download/export certificates from Trusted Signing Jun 26, 2024
@mjcheetham mjcheetham closed this Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant