Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
General Reference
Strong Naming
 StrongNameKeyGen Function
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework General Reference 
StrongNameKeyGen Function 
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

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

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

Parameters

Parameter Description

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 function to release the allocated memory.

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

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: StrongName.h

Library: Included as a resource in MsCorEE.dll

.NET Framework Version: 2.0, 1.1, 1.0

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker