Partilhar via


Como: Assinar um Assembly (Visual Studio)

Assembly signing (also called strong-name signing) gives an application or component a unique identity that other software can use to identify and refer explicitly to it. A strong name consists of its simple text name, version number, culture information (if provided), plus a public/private key pair. This information is stored in a key file; this can be a Personal Information Exchange (PFX) file or a certificate from the current user's Windows certificate store. For more information, see Assinatura de Nome Forte para Aplicativos Gerenciados.

ObservaçãoObservação

For the purpose of assembly signing, Visual Studio supports only Personal Information Exchange (.pfx) and Strong Name Key (.snk) files stored in the project system on the local computer.

In some cases, you may only have access to a public key. If so, you can use delay signing to defer assigning the private key. For more information, see Como: Atrasar a assinatura de um Assembly (Visual Studio).

You can sign your assembly using the options in the Signing page of the Project Designer as follows; for more information, see Assinatura de Página, o criador do projeto.

The following procedures apply to signing the assembly only. If you want to sign the application and deployment manifests, see Como: Assinar manifestos de aplicativo e implantação.

To sign an assembly using a new key file

  1. With the project node selected in Solution Explorer, from the Project menu, click Properties (or right-click the project node in Solution Explorer, and click Properties).

  2. In the Project Designer, click the Signing tab.

  3. Select the Sign the assembly check box.

  4. Specify a new key file. In the Choose a strong name key file drop-down list, select <New...>. Note that new key files are always created in the .pfx format.

    The Criar a caixa de diálogo de chave de nome forte appears.

  5. In the Create Strong Name Key dialog box, enter a name and password for the new key file, and then click OK.

    ObservaçãoObservação

    Optionally, you can enable delay signing by selecting the Delay sign only check box. For more information, see Como: Atrasar a assinatura de um Assembly (Visual Studio).

To sign an assembly using an existing key file

  1. With the project node selected in Solution Explorer, from the Project menu, click Properties (or right-click the project node in Solution Explorer, and click Properties).

  2. In the Project Designer, click the Signing tab.

  3. Select the Sign the assembly check box.

  4. Specify an existing key file. In the Choose a strong name key file drop-down list, select <Browse...>.

  5. In the Select File dialog box, navigate to the key file or enter its path in the File name box; then click Open to select it. (For more information, see Como: Criar um par de chaves pública/particular.)

    ObservaçãoObservação

    You can change the password for the key file by clicking Change Password. In the Caixa de diálogo Change Key Password, enter the old password, and then enter the new password twice.

    ObservaçãoObservação

    Optionally, you can enable delay signing by selecting the Delay sign only check box. For more information, see Como: Atrasar a assinatura de um Assembly (Visual Studio).

Consulte também

Tarefas

Como: Atrasar a assinatura de um Assembly (Visual Studio)

Conceitos

Assinatura de Nome Forte para Aplicativos Gerenciados

Outros recursos

Gerenciando Assinatura de Assembly e Manifesto