Desktop Functions: Smart Device Functions:
|
StrongNameSignatureVerification (mscorsn)
C# Signature:
[DllImport("mscorsn.dll")] /// <summary> /// Verify a strong name/manifest against a public key blob /// </summary> /// <param name="wszFilePath">valid path to the PE file for the assembly</param> /// <param name="dwInFlags">flags modifying behavior</param> /// <param name="pdwOutFlags">[out] additional output info</param> [DllImport("mscoree.dll")] public static extern bool StrongNameSignatureVerification([MarshalAs(UnmanagedType.LPWStr)]string wszFilePath, StrongNameInFlags dwInFlags, Out StrongNameOutFlags pdwOutFlags); User-Defined Types:StrongNameInFlags, StrongNameOutFlags /// <summary> /// Flags for use with the verify routines /// </summary> public enum StrongNameInFlags : int {
/// <summary>verify even if the settings in the registry disable it</summary> Notes: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.
/// <summary>verification is the first (on entry to the cache)</summary> Tips & Tricks:Please add some!
/// <summary>cache protects assembly from all but admin access</summary> Sample Code:Please add some!
/// <summary>cache protects user's assembly from other users</summary>
/// <summary>cache provides no access restriction guarantees</summary> } /// <summary> /// Flags for use with the verify routines /// </summary> public enum StrongNameOutFlags : int {
/// <summary>set to false if verify succeeded due to registry settings</summary> } Notes: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:StrongNameSignatureVerificationEx should generally be used instead of this API, since it provides a nicer wrapper, and StrongNameSignatureVerification does not provide extra user-accessable functionality. Sample Code:/// <summary> /// Verify an assembly's strong name /// </summary> /// <param name="assembly">assembly to verify</param> /// <param name="forceVerification">true to ignore the skip verify registry</param> /// <returns>true if the assembly verifies, false otherwise</returns> private static bool VerifyAssembly(string assembly, bool forceVerification) {
// make sure the assembly is there } Alternative Managed API:Do you know one? Please contribute it! Please edit this page!Do you have...
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). |
|