Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

StrongNameKeyGen (mscorsn)
 
.
Summary
Generate a new key pair with the specified size for strong name use
Summary
TODO - Generate a new key pair for strong name use

C# Signature:

/// <summary>
///     Generate a new key pair with the specified key size for strong name use
///     Generate a new key pair for strong name use
/// </summary>
/// <param name="wszKeyContainer">desired key container name</param>
/// <param name="dwFlags">flags</param>
/// <param name="dwKeySize">desired key size</param>
/// <param name="ppbKeyBlob">[out] generated public / private key blob</param>
/// <param name="pcbKeyBlob">[out] size of the generated blob</param>
/// <returns>true if the key was generated, false if there was an error</returns>
[DllImport("mscoree.dll")]
extern static bool StrongNameKeyGenEx([MarshalAs(UnmanagedType.LPWStr)] string
   wszKeyContainer, StrongNameKeyGenFlags dwFlags, int dwKeySize,
   [Out]out IntPtr ppbKeyBlob, [Out]out long pcbKeyBlob);
public extern static bool StrongNameKeyGen([MarshalAs(UnmanagedType.LPWStr)] string
   wszKeyContainer, StrongNameKeyGenFlags dwFlags, [Out]out IntPtr ppbKeyBlob,
   [Out]out long pcbKeyBlob)

User-Defined Types:

StrongNameKeyGenFlags

StrongNameKeyGenFlags

Notes:

This strong name API has been moved to mscoree.dll for Whidbey. It is not available in the v1.0 or v1.1 versions of the framework.

This function is exported from mscorsn.dll in v1.0 and v1.1 of the .NET framework, but it will be moved to mscorwks.dll in v2.0. There is a shim in mscoree.dll which will redirect to the appropriate implementation dll, which has the same name.

Tips & Tricks:

Please add some!

Sample Code:

For a sample of generating a key, and some more documentation on this function, see Shawn Farkas' blog: http://blogs.msdn.com/shawnfa/archive/2004/07/09/178902.aspx

See the sample on Shawn Farkas' blog for a complete sample of using this API: http://blogs.msdn.com/shawnfa/archive/2004/07/09/178902.aspx

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions