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]
> }
> }