Compartilhar via


SecurityUtilities.SignFile Method

Definition

Signs a ClickOnce manifest or PE file.

Overloads

SignFile(X509Certificate2, Uri, String)

Signs a ClickOnce manifest or PE file.

SignFile(String, Uri, String)

Signs a ClickOnce manifest or PE file.

SignFile(String, SecureString, Uri, String)

Signs a ClickOnce manifest.

SignFile(String, Uri, String, String)

Signs a ClickOnce manifest or PE file.

SignFile(String, Uri, String, String, String)

Signs a ClickOnce manifest or PE file.

SignFile(String, Uri, String, String, String, Boolean)

Signs a ClickOnce manifest or PE file.

SignFile(X509Certificate2, Uri, String)

Source:
SecurityUtil.cs

Signs a ClickOnce manifest or PE file.

public:
 static void SignFile(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ cert, Uri ^ timestampUrl, System::String ^ path);
public static void SignFile (System.Security.Cryptography.X509Certificates.X509Certificate2 cert, Uri timestampUrl, string path);
static member SignFile : System.Security.Cryptography.X509Certificates.X509Certificate2 * Uri * string -> unit
Public Shared Sub SignFile (cert As X509Certificate2, timestampUrl As Uri, path As String)

Parameters

cert
X509Certificate2

The certificate to be used to sign the file.

timestampUrl
Uri

URL that specifies an address of a time stamping server.

path
String

Path of the file to sign with the certificate.

Remarks

This function can only sign a PE file if the X509Certificate2 parameter represents a certificate in the current user's personal certificate store.

Applies to

SignFile(String, Uri, String)

Source:
SecurityUtil.cs

Signs a ClickOnce manifest or PE file.

public:
 static void SignFile(System::String ^ certThumbprint, Uri ^ timestampUrl, System::String ^ path);
public static void SignFile (string certThumbprint, Uri timestampUrl, string path);
static member SignFile : string * Uri * string -> unit
Public Shared Sub SignFile (certThumbprint As String, timestampUrl As Uri, path As String)

Parameters

certThumbprint
String

Hexadecimal string that contains the SHA-1 hash of the certificate.

timestampUrl
Uri

URL that specifies an address of a time stamping server.

path
String

Path of the file to sign with the certificate.

Remarks

This overload of the method calls SignTool.exe and therefore requires the .NET Framework 2.0 to be installed.

Applies to

SignFile(String, SecureString, Uri, String)

Source:
SecurityUtil.cs

Signs a ClickOnce manifest.

public:
 static void SignFile(System::String ^ certPath, System::Security::SecureString ^ certPassword, Uri ^ timestampUrl, System::String ^ path);
public static void SignFile (string certPath, System.Security.SecureString certPassword, Uri timestampUrl, string path);
static member SignFile : string * System.Security.SecureString * Uri * string -> unit
Public Shared Sub SignFile (certPath As String, certPassword As SecureString, timestampUrl As Uri, path As String)

Parameters

certPath
String

The certificate to be used to sign the file.

certPassword
SecureString

The certificate password.

timestampUrl
Uri

URL that specifies an address of a time stamping server.

path
String

Path of the file to sign with the certificate.

Remarks

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

Applies to

SignFile(String, Uri, String, String)

Source:
SecurityUtil.cs

Signs a ClickOnce manifest or PE file.

public:
 static void SignFile(System::String ^ certThumbprint, Uri ^ timestampUrl, System::String ^ path, System::String ^ targetFrameworkVersion);
public static void SignFile (string certThumbprint, Uri timestampUrl, string path, string targetFrameworkVersion);
static member SignFile : string * Uri * string * string -> unit
Public Shared Sub SignFile (certThumbprint As String, timestampUrl As Uri, path As String, targetFrameworkVersion As String)

Parameters

certThumbprint
String

Hexadecimal string that contains the SHA-1 hash of the certificate.

timestampUrl
Uri

URL that specifies an address of a time stamping server.

path
String

Path of the file to sign with the certificate.

targetFrameworkVersion
String

Version of the .NET Framework for the target.

Applies to

SignFile(String, Uri, String, String, String)

Source:
SecurityUtil.cs

Signs a ClickOnce manifest or PE file.

public:
 static void SignFile(System::String ^ certThumbprint, Uri ^ timestampUrl, System::String ^ path, System::String ^ targetFrameworkVersion, System::String ^ targetFrameworkIdentifier);
public static void SignFile (string certThumbprint, Uri timestampUrl, string path, string targetFrameworkVersion, string targetFrameworkIdentifier);
static member SignFile : string * Uri * string * string * string -> unit
Public Shared Sub SignFile (certThumbprint As String, timestampUrl As Uri, path As String, targetFrameworkVersion As String, targetFrameworkIdentifier As String)

Parameters

certThumbprint
String

Hexadecimal string that contains the SHA-1 hash of the certificate.

timestampUrl
Uri

URL that specifies an address of a time stamping server.

path
String

Path of the file to sign with the certificate.

targetFrameworkVersion
String

Version of the .NET Framework for the target.

targetFrameworkIdentifier
String

.NET Framework identifier for the target.

Applies to

SignFile(String, Uri, String, String, String, Boolean)

Source:
SecurityUtil.cs

Signs a ClickOnce manifest or PE file.

public:
 static void SignFile(System::String ^ certThumbprint, Uri ^ timestampUrl, System::String ^ path, System::String ^ targetFrameworkVersion, System::String ^ targetFrameworkIdentifier, bool disallowMansignTimestampFallback);
public static void SignFile (string certThumbprint, Uri timestampUrl, string path, string targetFrameworkVersion, string targetFrameworkIdentifier, bool disallowMansignTimestampFallback);
static member SignFile : string * Uri * string * string * string * bool -> unit
Public Shared Sub SignFile (certThumbprint As String, timestampUrl As Uri, path As String, targetFrameworkVersion As String, targetFrameworkIdentifier As String, disallowMansignTimestampFallback As Boolean)

Parameters

certThumbprint
String

Hexadecimal string that contains the SHA-1 hash of the certificate.

timestampUrl
Uri

URL that specifies an address of a time stamping server.

path
String

Path of the file to sign with the certificate.

targetFrameworkVersion
String

Version of the .NET Framework for the target.

targetFrameworkIdentifier
String

.NET Framework identifier for the target.

disallowMansignTimestampFallback
Boolean

Disallow fallback to legacy timestamping when RFC3161 timestamping fails during manifest signing

Applies to