Source code of Windows XP (NT5)
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.

69 lines
1.9 KiB

  1. <%@ CODEPAGE=65001 'UTF-8%>
  2. <%' certcrl.crl - (CERT)srv web - return a (C)ertificate (R)evocation (L)ist
  3. ' Copyright (C) Microsoft Corporation, 1998 - 1999 %>
  4. <!-- #include FILE=certdat.inc -->
  5. <!-- #include FILE=certsrck.inc -->
  6. <% ' ########## BEGIN SERVER SIDE EXECUTION ##########
  7. 'Process a Certificate Request
  8. Dim nResult, sCrl, sErrMsg, nEncoding, nCrlType
  9. On Error Resume Next
  10. ' from \nt\public\sdk\inc\certcli.h
  11. Const CR_OUT_BASE64HEADER=&H00000000
  12. Const CR_OUT_BASE64=&H00000001
  13. Const CR_OUT_BINARY=&H00000002
  14. Const CR_OUT_CHAIN=&H00000100
  15. Const CR_PROP_BASECRL=17
  16. Const CR_PROP_DELTACRL=18
  17. Const PROPTYPE_BINARY=3
  18. 'Stop 'debugging breakpoint
  19. ' determine the requested encoding
  20. If "bin"=Request.QueryString("Enc") Then
  21. nEncoding=CR_OUT_BINARY
  22. Else '"b64"=Request.QueryString("Enc")
  23. nEncoding=CR_OUT_BASE64HEADER
  24. End If
  25. ' determine the requested CRL type
  26. If "delta"=Request.QueryString("Type") Then
  27. nCrlType=CR_PROP_DELTACRL
  28. Else '"base"=Request.QueryString("Type")
  29. nCrlType=CR_PROP_BASECRL
  30. End If
  31. ' create the object to do the request
  32. Set Session("ICertRequest")=Server.CreateObject("CertificateAuthority.Request")
  33. Set ICertRequest=Session("ICertRequest")
  34. Err.Clear 'make sure we catch the HRESULT and not some earlier error
  35. ' get the crl
  36. sCrl=ICertRequest.GetCAProperty(sServerConfig, nCrlType, Request.QueryString("Renewal"), PROPTYPE_BINARY, nEncoding)
  37. nResult=Err.number
  38. sErrMsg=Err.Description
  39. If 0<>nResult Then
  40. 'internal redirect - transfer control to error page
  41. Session("nResult")=nResult
  42. Session("sErrMsg")=sErrMsg
  43. Server.Transfer("certrser.asp")
  44. End If
  45. ' Tell the client we are sending a CRL
  46. Response.ContentType="application/pkix-crl"
  47. ' send the CRL to the client
  48. Response.Clear 'guarantee no extraneous bytes
  49. If CR_OUT_BINARY=nEncoding Then
  50. Response.BinaryWrite(sCrl)
  51. Else
  52. Response.Write(sCrl)
  53. End If
  54. ' ########## END SERVER SIDE EXECUTION ##########
  55. %>