Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.7 KiB

  1. The source code in this directory can be used to build a sample Policy Module
  2. for Microsoft Certificate Services. It is meant to run on Windows NT 4.0 with
  3. SP3 or later or on Windows 2000 only. Certificate Services must already be
  4. installed.
  5. Certificate Services calls the Policy Module through the ICertPolicy
  6. interface, and the Policy Module can call back to Certificate Services
  7. through the ICertServerPolicy interface.
  8. Each time Certificate Services receives a certificate request, it passes
  9. control to the CCertPolicy::VerifyRequest method in policy.cls. The passed
  10. Context parameter is used with the ICertServerPolicy interface to retrieve
  11. properties from the request and potential certificate. The VerifyRequest
  12. method may add, modify or enable Certificate Extensions, modify the NotBefore
  13. and NotAfter dates and Subject name RDN (Relative Distinguished Name) strings
  14. for the potential certificate. It must also perform any validation required,
  15. and decide the disposition of the request. The method should return one of
  16. VR_PENDING, VR_INSTANT_OK or VR_INSTANT_BAD to cause the request to be made
  17. pending, to grant the request and issue the certificate, or to fail the
  18. request.
  19. Once the policyvb.dll DLL is built, its COM interface must be registered
  20. via the following command:
  21. regsvr32 policyvb.dll
  22. Once registered, the Windows 2000 Certification Authority management console
  23. snapin can be used to make this the active policy module.
  24. The Certificate Services service must then be stopped and restarted as
  25. a console application to load the newly registered Policy Module. Use the
  26. Control Panel's Services applet, and stop the "Certificate Services" service,
  27. then start Certificate Services as a console application via the following
  28. command:
  29. certsrv -z
  30. NOTE: Because this Visual Basic Policy Module uses an Interactive Form to
  31. display information passed in the certificate request, IT MUST BE STARTED VIA
  32. THE ABOVE COMMAND AS A CONSOLE APPLICATION in order to interact with the
  33. desktop to display the form and accept the user's input.
  34. NOTE: To build this Visual Basic Policy Module for Cert Server 1.0, the Name=
  35. value in policytvb.vbp should be changed to:
  36. Name="CertificateAuthority"
  37. NOTE: Due to threading constraints, an ignorable fault may be observed during
  38. Cert Server 1.0 console mode shutdown when running with a Visual Basic Policy
  39. Module.
  40. Files:
  41. ------
  42. const.bas -- Constant definitions
  43. main.bas -- main definition
  44. mssccprj.scc -- stub source code control file
  45. policy.cls -- Implements ICertPolicy
  46. policyvb.frm -- Form definition
  47. policyvb.vbp -- Visual Basic Project file
  48. policyvb.vbw -- Visual Basic Workspace file
  49. polman.cls -- Implements ICertManageModule