Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / June 2004

Tip: Looking for answers? Try searching our database.

Certificate Exit Module

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gareth - 24 May 2004 13:52 GMT
I'm trying to write an exit module for the Microsoft Certificate Authority
in C#.

I've wrapped certxds.dll to an interop and implemented the CCertExit
Interface

Then registered the dll using the following
regsvcs MyExitModule.dll
regasm MyExitModule.dll
gacutil /i MyExitModule.dll

but Certificate Authority doesn't see my exit module.
I assume that com isn't aware that I'm inheriting CCertExit

How do I get C# to tell COM that it's inheriting the COM CCertExit interface

Here is an example

internal enum ExitEvent : int
{
   Invalid = 0x0,
   CertIssued = 0x1,
   CertPending = 0x2,
   CertDenied = 0x4,
   CertRevoked = 0x8,
   CertRetrievePending = 0x10,
   CRLIssued = 0x20,
   Shutdown = 0x40
}

public class Exit : CERTEXITLib.CCertExit
{
   public string GetDescription()
   {
       return "MyExitModiue";
   }

   public Int32 Initialize(string strConfig)
   {
       Logger.Log(LOGINFO, "CA Exit Module initialized.",
SeverityLevel.ImportantInfo);
       return (Int32)(ExitEvent.CertIssued | ExitEvent.CertPending |
ExitEvent.CertDenied | ExitEvent.CertRevoked | ExitEvent.CertRetrievePending
|         ExitEvent.Shutdown);
   }

   public void Notify(Int32 exitEvent, Int32 context)
   {
          //DO Stuff....
   }
}
akhare1 - 03 Jun 2004 01:02 GMT
> I'm trying to write an exit module for the Microsoft Certificate Authority
> in C#.
[quoted text clipped - 25 lines]
>     Shutdown = 0x40
> }

In the first place, I would inherit from the ICertExit interface
(should be part of your Interop DLL).
public class Exit : CERTEXITLib.ICertExit

Next, add the following attributes to your class:
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]

Make sure that you create a ProgID to HKCR that looks like
MyExitModule.Exit and add a CLSID key under it and set the default
value w/ your DLL's CLSID (you can search for this using your
assembly's name after using regasm). Note that if you are running
Win2K3 you may want to support the ICertExit2 and ICertManageModule
interfaces. Then again, VS.NET 2003 makes adding those interfaces
trivial!!!

> public class Exit : CERTEXITLib.CCertExit
> {
[quoted text clipped - 17 lines]
>     }
> }

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.