473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Certification Server Exit Module (Tough Problem)

I am trying to write an Exit module for the Certification server in VB.NET
and I cant get the module to be recognised by the Certification MMC snap in.
Its function is to capture Serial Numbers of newly created certificates.

This is quite obscure and I cant really find any example code. On the face
of it it looks pretty straightforward.

I have created a Class Library and created a class called Exit as this is
suggested for VB, tho I am not sure this is relevant to .Net. I have
referenced the two classes I need and its created the Interop classes. I
have implemented, as the SDK suggests, both ICertExit and ICertManageModule.
I need both of these for the module any way as I want to be able to have a
dialog. The project has the 'Register for COM Interop' ticked. In OLEVIEW
it's got both the interfaces yet when I try to add it its not presented in
the in list of Exit Modules in the Certificate Authority MMC properties
page.

I added the ComClass attribute in an attempt to get it to work, seems to
makes no obvious difference apart from adding more GUID's to the registry.

When I click the Add button on the Exit Modules dialog, a check with RegMon
shows me that it enumerates all the com classes and picks up
ICertManageExitModuleClass which implements the ICertManageModule , but
irritatingly not my Class which also implements that interface.

I am doing something wrong, anyone know what?

Alex
The code -
Imports System.security.Cryptography
Imports Microsoft.VisualBasic

<ComClass([Exit].ClassId, [Exit].InterfaceId, [Exit].EventsId)> _

Public Class [Exit]

Inherits System.Attribute

Implements CERTEXITLib.ICertExit, CERTEXITLib.ICertManageModule

Public Const ClassId As String = "0CFBCAED-CECA-4f74-8589-38B4EBB65F9B"

Public Const InterfaceId As String = "D2E8E505-B72F-46b1-BC80-464D1C8B3D7B"

Public Const EventsId As String = "BA4CD6A0-8909-49a4-A47D-2B3F2D8D3810"

' Values of interest for Initialize

Const EXITEVENT_INVALID As Integer = 0

Const EXITEVENT_CERTISSUED As Integer = &H1

Const EXITEVENT_CERTPENDING As Integer = &H2

Const EXITEVENT_CERTDENIED As Integer = &H4

Const EXITEVENT_CERTREVOKED As Integer = &H8

Const EXITEVENT_CERTRETRIEVEPENDING As Integer = &H10

Const EXITEVENT_CRLISSUED As Integer = &H20

Const EXITEVENT_SHUTDOWN As Integer = &H40

Const PROPTYPE_LONG As Integer = &H1

Const PROPTYPE_DATE As Integer = &H2

Const PROPTYPE_BINARY As Integer = &H3

Const PROPTYPE_STRING As Integer = &H4

Public Function Initialize(ByVal strConfig As String) As Integer Implements
CERTEXITLib.ICertExit.Initialize

Return EXITEVENT_CERTISSUED Or EXITEVENT_CERTREVOKED

End Function

Public Sub Notify(ByVal ExitEvent As Integer, ByVal Context As Integer)
Implements CERTEXITLib.ICertExit.Notify

Dim EventLog As New System.Diagnostics.EventLog

Try

Select Case ExitEvent

Case EXITEVENT_CERTISSUED

EventLog.WriteEntry("Cert Event - Certificate Issued")

Dim CertExitObject As New CERTCLIENTLib.CCertServerExit

CertExitObject.SetContext(Context)

Dim strSerialNumber As String

Try

strSerialNumber =
CType(CertExitObject.GetCertificateProperty("Seria lNumber",
PROPTYPE_STRING), String)

Catch ex As Exception

strSerialNumber = Nothing

End Try

If strSerialNumber = Nothing Then

EventLog.WriteEntry("Serial number type conversion failed")

Exit Sub

End If

EventLog.WriteEntry("Serial Number of issued certificate = " &
strSerialNumber)

Case EXITEVENT_CERTREVOKED

EventLog.WriteEntry("Cert Event - Certificate Revoked")

Case Else

End Select

Catch ex As Exception

EventLog.WriteEntry("There was an unhandled exception")

End Try

End Sub

Public Function GetDescription() As String Implements
CERTEXITLib.ICertExit.GetDescription

Return "Custom Exit Module (Dev)"

End Function

Public Sub Configure(ByVal strConfig As String, ByVal strStorageLocation As
String, ByVal Flags As Integer) Implements
CERTEXITLib.ICertManageModule.Configure

End Sub

Public Function GetProperty(ByVal strConfig As String, ByVal
strStorageLocation As String, ByVal strPropertyName As String, ByVal Flags
As Integer) As Object Implements CERTEXITLib.ICertManageModule.GetProperty

Return Nothing

End Function

Public Sub SetProperty(ByVal strConfig As String, ByVal strStorageLocation
As String, ByVal strPropertyName As String, ByVal Flags As Integer, ByRef
pvarProperty As Object) Implements CERTEXITLib.ICertManageModule.SetProperty

End Sub

Public Sub New()

MyBase.new()

End Sub

End Class


Jul 21 '05 #1
0 1832

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Maxwell Hammer | last post by:
An application I am developing executes many threads and then has a "monitor" part that waits for certain events. One of these events causes the application to have to shutdown. On shutdown the...
12
by: Oba | last post by:
I am currently hitting my head on the wall to get certified on 9i, but we now have 10g, so do I hold off or continue my work? Please advice thanks.
10
by: Vanessa BJ | last post by:
Hi. I am an amateur C# enthusiast. I currently work as a carpenter and I moonlight on the weekends as a photographer. I'm trying to transition a career change. Is there an exam that leads to...
0
by: Alex | last post by:
I am trying to write an Exit module for the Certification server in VB.NET and I cant get the module to be recognised by the Certification MMC snap in. Its function is to capture Serial Numbers of...
5
by: Lauren Wilson | last post by:
The more I look at the issue of digital certification for our Access app, the more confused I get. The SelfCert feature that allegedly installed with Office 2003 does not work. The entry is on my...
19
by: natG | last post by:
On a warehouse app, our Java clients constantly load/insert rows into the db. I would like to throttle these inserts (1.5 million rows per hr) from the Java app, based on current 'busy state' of...
5
by: cypher_key | last post by:
I've currently started my MCAD certification. I'm wondering, however, if it would be a better idea to take the MCTS for the 2.0 framework instead. I realize I can upgrade from a MCAD to a MCPD, but...
5
by: rhino | last post by:
I have some questions about DB2 certification. 1. Are the DB2 V8 exams still available, specifically in the Toronto area? I went to the certification portion of the IBM website and it took me to...
1
by: jineshpmj123 | last post by:
Hi, I have a problem with processing WSDL file using SOAP. I want to call Rhapsody webservice using Python. But i have SSL certification key and cert , how to pass this information when i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.