dotnet / dotnet/msbuild

[Feature Request] Extend SecurityUtil to allow specifying PrivateKey

Open
#7,542 4 comments 0 reactions 0 assignees View on GitHub
Area: ClickOnce triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

The SecurityUtil accepts only a X509Certificate2 as parameter. But in some scenarios the private key is not directly attached to the X509Certificate2 instance but loaded separately or even forwarded to a custom implementation performing the signing on Azure.

Therefore it would be good to add a new overload `public static void SignFile(X509Certificate2 cert, AsymmetricAlgorithm privateKey, Uri timestampUrl, string path)` where callers can specify an own private key instance.

This should then replace the loading of the certificate in https://github.com/dotnet/msbuild/blob/44ad46fed8c5f7e5800e93f61f265b2efaa8ea5e/src/Tasks/ManifestUtil/SecurityUtil.cs#L672

This is useful when you programatically sign ClickOnce applications without Mage.exe or similar.

If this feature is accepted I would be willing to contribute it.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.