Strong-named assemblies are digitally signed. This helps the runtime determine whether an assembly has been changed after signing.
Because Dotfuscator modifies assemblies during protection, signing must occur after Dotfuscator processes the assembly. Dotfuscator can handle this step as part of the obfuscation process.
Configure signing in the Config Editor
You can configure signing from the Dotfuscator Config Editor.
To configure signing:
- Open your Dotfuscator configuration file in the Config Editor.
- In the navigation tree, go to Settings > Signing.
- Select the signing options that apply to your assemblies.
The Signing page includes the following options:
| Option | Description |
| Re-sign Strong Named Assemblies | Re-signs assemblies that were already strong-named before Dotfuscator processed them. |
| Use Strong Name Utility | Uses the Strong Name Tool instead of Dotfuscator’s built-in strong name signing functionality. If the tool is not found, Dotfuscator displays an information message and uses its built-in signing functionality. |
| Do not use attributes to find key | Prevents Dotfuscator from using key information specified through assembly attributes, such as System.Reflection.AssemblyKeyFileAttribute. Use this option when you want to provide the key file or key container directly in the configuration. |
| Key File | Specifies the key file used to re-sign the assembly. |
| Key Container | Specifies the key container used to re-sign the assembly. |
| Finish Signing Delay Signed Assemblies | Completes the signing process for delay-signed assemblies. |
| Key File | Specifies the private key file used to finish signing delay-signed assemblies. |
Re-Signing Strong-Named Assemblies
Dotfuscator can automatically re-sign strongly named assemblies after obfuscation.
Dotfuscator can:
- Re-sign assemblies that are already strongly named.
- Complete the signing process for delay-signed assemblies.
You can configure Dotfuscator to locate the public/private key pair explicitly, or rely on the location specified by custom attributes on the input assembly, such as System.Reflection.AssemblyKeyFileAttribute.
Re-Sign with an Explicit Key File
You can configure Dotfuscator to re-sign an assembly with an explicit key file. When an explicit key file is configured, any key file specified through a custom attribute is not used.
Example:
<signing>
<resign>
<option>dontuseattributes</option>
<key>
<file dir="c:\temp" name="key.snk" />
</key>
</resign>
</signing>Use the Strong Name Tool
By default, Dotfuscator uses its built-in strong name signing functionality.
You can also configure Dotfuscator to use the Strong Name Tool. Dotfuscator searches for the Strong Name Tool executable in its default location. If the executable is not found, Dotfuscator displays an information message and falls back to its built-in signing functionality.
Example:
<signing>
<resign>
<option>usestrongname</option>
</resign>
</signing>Finish Signing Delay-Signed Assemblies
If an input assembly is delay signed, Dotfuscator can complete the signing process. Configure Dotfuscator with the private key required to finish signing the assembly.
Example:
<signing>
<delaysign>
<key>
<file dir="c:\temp" name="key.snk" />
</key>
</delaysign>
</signing>