Rediger

Del via


ICLRStrongName::StrongNameSignatureGeneration Method

Generates a strong name signature for the specified assembly.

Syntax

HRESULT StrongNameSignatureGeneration (
    [in]  LPCWSTR   wszFilePath,  
    [in]  LPCWSTR   wszKeyContainer,  
    [in]  BYTE      *pbKeyBlob,  
    [in]  ULONG     cbKeyBlob,  
    [out] BYTE      **ppbSignatureBlob,  
    [out] ULONG     *pcbSignatureBlob  
);  

Parameters

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

wszKeyContainer
[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).

The keys must be 1024-bit Rivest-Shamir-Adleman (RSA) signing keys. No other types of keys are supported at this time.

pbKeyBlob
[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.

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

ppbSignatureBlob
[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 by using the ICLRStrongName::StrongNameFreeBuffer method.

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

Return Value

S_OK if the method completed successfully; otherwise, an HRESULT value that indicates failure (see Common HRESULT Values for a list).

Remarks

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

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

Requirements

Platforms: See System Requirements.

Header: MetaHost.h

Library: Included as a resource in MSCorEE.dll

.NET Framework Versions: Available since 4

See also