StrongNameKeyGen Function

Creates a new public/private key pair for strong name use.

This function has been deprecated. Use the ICLRStrongName::StrongNameKeyGen method instead.

BOOLEAN StrongNameKeyGen (
    [in]  LPCWSTR   wszKeyContainer,
    [in]  DWORD     dwFlags,
    [out] BYTE      **ppbKeyBlob,
    [out] ULONG     *pcbKeyBlob
);

wszKeyContainer

[in] The requested key container name. wszKeyContainer must be a non-empty string, or null to generate a temporary name.

dwFlags

[in] Specifies whether to leave the key registered. The following values are supported:

  • 0x00000000 - Used when wszKeyContainer is null to generate a temporary key container name.

  • 0x00000001 (SN_LEAVE_KEY) - Specifies that the key should be left registered.

ppbKeyBlob

[out] The returned public/private key pair.

pcbKeyBlob

[out] The size, in bytes, of ppbKeyBlob.

true on successful completion; otherwise, false.

The StrongNameKeyGen function creates a 1024-bit key. After the key is retrieved, you should call the StrongNameFreeBuffer function to release the allocated memory.

If the StrongNameKeyGen 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.5.2, 4.5.1, 4.5, 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0, 1.1, 1.0

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft