SecurityUtilities.SignFile Method (X509Certificate2, Uri, String)
Signs a ClickOnce manifest or PE file.
MSBuild is now included in Visual Studio instead of the .NET Framework.You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Namespace: Microsoft.Build.Tasks.Deployment.ManifestUtilities
Assembly: Microsoft.Build.Tasks.Core (in Microsoft.Build.Tasks.Core.dll)
Syntax
'Declaration
Public Shared Sub SignFile ( _
cert As X509Certificate2, _
timestampUrl As Uri, _
path As String _
)
public static void SignFile(
X509Certificate2 cert,
Uri timestampUrl,
string path
)
public:
static void SignFile(
X509Certificate2^ cert,
Uri^ timestampUrl,
String^ path
)
static member SignFile :
cert:X509Certificate2 *
timestampUrl:Uri *
path:string -> unit
public static function SignFile(
cert : X509Certificate2,
timestampUrl : Uri,
path : String
)
Parameters
cert
Type: System.Security.Cryptography.X509Certificates.X509Certificate2The certificate to be used to sign the file.
timestampUrl
Type: System.UriIndicates that the file is to be timestamped by the timestamp server at the specified HTTP address. This parameter can be NULL if you do not want a timestamp.
path
Type: System.StringThe name of the file to sign.
Remarks
This function can only sign a PE file if the X509Certificate2 parameter represents a certificate in the current user's personal certificate store.
This overload of the method calls SignTool.exe and therefore requires the .NET Framework 2.0 to be installed.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.
See Also
Reference
Microsoft.Build.Tasks.Deployment.ManifestUtilities Namespace