This documentation is archived and is not being maintained.

StrongNameSignatureGenerationEx Function

Generates a strong name signature for the specified assembly, according to the specified flags.

This function has been deprecated in the .NET Framework version 4. Use the ICLRStrongName::StrongNameSignatureGenerationEx method instead.

BOOLEAN StrongNameSignatureGenerationEx (
    [in]  LPCWSTR   wszFilePath,
    [in]  LPCWSTR   wszKeyContainer,
    [in]  BYTE      *pbKeyBlob,
    [in]  ULONG     cbKeyBlob,
    [out] BYTE      **ppbSignatureBlob,
    [out] ULONG     *pcbSignatureBlob,
    [in]  DWORD     dwFlags


[in] The path to the file that contains the manifest of the assembly for which the strong name signature will be generated.


[in] The name of the key container that contains the public/private key pair.

If pbKeyBlob is null, wszKeyContainer must specify a valid container within the cryptographic service provider (CSP). In this case, the key pair stored in the container is used to sign the file.

If pbKeyBlob is not null, the key pair is assumed to be contained in the key binary large object (BLOB).


[in] A pointer to the public/private key pair. This pair is in the format created by the Win32 CryptExportKey function. If pbKeyBlob is null, the key container specified by wszKeyContainer is assumed to contain the key pair.


[in] The size, in bytes, of pbKeyBlob.


[out] A pointer to the location to which the common language runtime returns the signature. If ppbSignatureBlob is null, the runtime stores the signature in the file specified by wszFilePath.

If ppbSignatureBlob is not null, the common language runtime allocates space in which to return the signature. The caller must free this space using the StrongNameFreeBuffer function.


[out] The size, in bytes, of the returned signature.


[in] One or more of the following values:

  • SN_SIGN_ALL_FILES (0x00000001) - Recompute all hashes for linked modules.

  • SN_TEST_SIGN (0x00000002) - Test-sign the assembly.

true on successful completion; otherwise, false.

Specify null for wszFilePath to calculate the size of the signature without creating the signature.

The signature can be either stored directly in the file, or returned to the caller.

If SN_SIGN_ALL_FILES is specified but a public key is not included (both pbKeyBlob and wszFilePath are null), hashes for linked modules are recomputed, but the assembly is not re-signed.

If SN_TEST_SIGN is specified, the common language runtime header is not modified to indicate that the assembly is signed with a strong name.

If the StrongNameSignatureGenerationEx function does not complete successfully, call the StrongNameErrorInfo function to retrieve the last generated error.

Platforms: See .NET Framework System Requirements.

Header: StrongName.h

Library: Included as a resource in MsCorEE.dll

.NET Framework Versions: 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0, 1.1, 1.0