Partager via


SecurityUtilities.SignFile Method (String, SecureString, Uri, String)

Signs a ClickOnce manifest.

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 ( _
    certPath As String, _
    certPassword As SecureString, _
    timestampUrl As Uri, _
    path As String _
)
public static void SignFile(
    string certPath,
    SecureString certPassword,
    Uri timestampUrl,
    string path
)
public:
static void SignFile(
    String^ certPath, 
    SecureString^ certPassword, 
    Uri^ timestampUrl, 
    String^ path
)
static member SignFile : 
        certPath:string * 
        certPassword:SecureString * 
        timestampUrl:Uri * 
        path:string -> unit
public static function SignFile(
    certPath : String, 
    certPassword : SecureString, 
    timestampUrl : Uri, 
    path : String
)

Parameters

  • certPath
    Type: System.String

    The certificate to be used to sign the file. The certificate must contain a private key. The KeyUsage extension is optional, but if it is present, DigitalSignature must be set to True. The EnhancedKeyUsage extension is also optional, but if it is present, the certificate must contain object identifier (OID) support.

  • certPassword
    Type: SecureString

    The certificate password.

  • timestampUrl
    Type: System.Uri

    Indicates 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.

Remarks

This function is only for signing a manifest, not a PE file.

.NET Framework Security

See Also

Reference

SecurityUtilities Class

SignFile Overload

Microsoft.Build.Tasks.Deployment.ManifestUtilities Namespace