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.

1050 lines
40 KiB

  1. <%@ CODEPAGE=65001 'UTF-8%>
  2. <%' certsces.asp - (CERT)srv web - (S)mart (C)ard (E)nrollment (S)tation
  3. ' Copyright (C) Microsoft Corporation, 1998 - 1999 %>
  4. <!-- #include FILE=certdat.inc -->
  5. <HTML>
  6. <Head>
  7. <Meta HTTP-Equiv="Content-Type" Content="text/html; charset=UTF-8">
  8. <Title>Microsoft Smart Card Enrollment Station</Title>
  9. <Script Language="VBScript">
  10. Option Explicit
  11. '---------------------------------------------------------------------
  12. ' Page global constants and variables
  13. ' page state constants
  14. Const e_ControlLoading=-1
  15. Const e_PageLoading=0
  16. Const e_PageDead=1
  17. Const e_PagePreEnroll=2
  18. Const e_PageEnrolling=3
  19. Const e_PagePostEnrollOK=4
  20. Const e_PagePostEnrollError=5
  21. Const e_PagePostEnrollDisp=6
  22. ' special return value for GetTemplateList and UpdateCSPList
  23. Const ERROR_NOITEMS=-1
  24. Const ERROR_NOMATCHEDCSP=-2
  25. ' flag constants for SCrdEnrl
  26. ' flags for getCertTemplateCount and enumCertTemplateName
  27. Const SCARD_ENROLL_ALL_CERT_TEMPLATE=0 'default
  28. Const SCARD_ENROLL_USER_CERT_TEMPLATE=1
  29. Const SCARD_ENROLL_MACHINE_CERT_TEMPLATE=2
  30. Const SCARD_ENROLL_ENTERPRISE_CERT_TEMPLATE=&H08
  31. Const SCARD_ENROLL_CROSS_CERT_TEMPLATE=&H20
  32. Const SCARD_ENROLL_OFFLINE_CERT_TEMPLATE=&H10
  33. ' flags for enumCertTemplateName, getCertTemplateName and setCertTemplateName
  34. Const SCARD_ENROLL_CERT_TEMPLATE_REAL_NAME=0 ' default
  35. Const SCARD_ENROLL_CERT_TEMPLATE_DISPLAY_NAME=4
  36. ' flags for enumCAName, getCAName and setCAName
  37. Const SCARD_ENROLL_CA_REAL_NAME=0 'default
  38. Const SCARD_ENROLL_CA_MACHINE_NAME=1
  39. Const SCARD_ENROLL_CA_DISPLAY_NAME=2
  40. Const SCARD_ENROLL_CA_UNIQUE_NAME=3 'machineName\realName
  41. ' flags for getSigningCertificateName, getEnrolledCertificateName
  42. Const SCARD_ENROLL_DISPLAY_CERT=0
  43. Const SCARD_ENROLL_NO_DISPLAY_CERT=1
  44. ' flags for setUserName and getUserName
  45. Const SCARD_ENROLL_SAM_COMPATIBLE_NAME=0 ' default
  46. Const SCARD_ENROLL_UPN_NAME=1
  47. ' flags for setSigningCertificate and selectSigningCertificate
  48. ' Const SCARD_SELECT_TEMPLATENAME = 0
  49. Const SCARD_SELECT_EKU = 1
  50. Const FLAGS_NONE=0
  51. ' the state of fields that can be invalid
  52. Dim g_bUserNameBad, g_bSigningCertBad, g_bTemplateBad, g_bCSPBad, g_fNewStation
  53. ' error string to display for e_PageDead and e_PagePostEnrollError
  54. Dim g_sPageError
  55. ' Strings to be localized
  56. Const L_DownloadingControl_Message="Downloading ActiveX control..."
  57. Const L_BadCPU_ErrorMessage="""Your CPU ("" + sError + "") is not supported.""" ' sError will be replaced w/ cpu type
  58. Const L_ControlLoadFailed_ErrorMessage="The proper version of the ActiveX control failed to download and install. You may not have sufficient permissions. Please ask your system administrator for assistance."
  59. Const L_ControlLoadFailedEx_ErrorMessage="""An unexpected error ("" + sError + "") occurred while downloading and installing the proper version of the ActiveX control. Please ask your system administrator for assistance."""
  60. Const L_PageLoading_Message="One moment please. Retrieving CSP list, certificate template list, and CA list."
  61. Const L_ControlLoading_Message="One moment please. Loading ActiveX control."
  62. Const L_PageDead_ErrorMessage="""An unexpected fatal error has occurred: "" + sError"
  63. Const L_MustSelect001_Message="Please select a user to enroll."
  64. Const L_MustSelect010_Message="Please select a signing certificate."
  65. Const L_MustSelect011_Message="Please select a user to enroll and a signing certificate."
  66. Const L_MustSelect100_Message="Please select a template which has a CA."
  67. Const L_MustSelect101_Message="Please select a user to enroll and a template which has a CA."
  68. Const L_MustSelect110_Message="Please select a signing certificate and a template which has a CA."
  69. Const L_MustSelect111_Message="Please select a user to enroll and a signing certificate and a template which has a CA."
  70. Const L_ReadyToEnroll_Message="Please insert the user's smart card into a reader and then press 'Enroll'."
  71. Const L_PageEnrolling_Message="Please wait while the user is enrolled..."
  72. Const L_PagePostEnrollOK_Message="The smart card is ready. Please press 'View Certificate' to make sure the certificate contains the correct personal information about the user."
  73. Const L_PagePostEnrollError_ErrorMessage="""An unexpected error occurred. Error: "" + sError" '"""The smart card enrollment failed: "" + sError"
  74. Const L_PagePostEnrollDisp_ErrorMessage="""Warning: "" + sError" '"""The smart card enrollment failed: "" + sError"
  75. Const L_IntErrBadStatus_ErrorMessage="!! Internal error !! - unknown page status"
  76. Const L_Unexpected_ErrorMessage="Unexpected Error"
  77. Const L_RetrvTemplateList_Message="Retrieving template list..."
  78. Const L_RetrvTemplateList_ErrorMessage="""An error ocurred while retrieving the template list. Error: "" + sError"
  79. Const L_NoTemplates_ErrorMessage="(No templates found!)"
  80. Const L_NoTemplatesLong_ErrorMessage="No templates could be found. There are no CAs from which you have permission to request a certificate, or an error occurred while accessing the Active Directory."
  81. Const L_RetrvCSPList_Message="Retrieving CSP list..."
  82. Const L_RetrvCSPList_ErrorMessage="""An error occurred while retrieving the CSP list. Error: "" + sError"
  83. Const L_NoCSPs_ErrorMessage="(No CSPs found!)"
  84. Const L_NoMatchedCSP_ErrorMessage="(No matched CSPs!)"
  85. Const L_NoMatchedCSP_Message="The CSPs supported by the current template is not found on this computer. Select different templates or use template management snapin to add CSPs installed on this computer to the template."
  86. Const L_RetrvCAList_Message="Retrieving CA list..."
  87. Const L_NoCAs_ErrorMessage="(No CA available for this template)"
  88. Const L_NoCertSelected_Message="(No certificate selected)"
  89. Const L_SelectSignCert_ErrorMessage="""An unexpected error occurred while selecting the signing certificate. Error: "" + sError"
  90. Const L_SelectUser_ErrorMessage="""An unexpected error occurred while selecting the user. Error: "" + sError"
  91. Const L_NoUserSelected_Message="(No user selected)"
  92. Const L_IntErrBadData_ErrorMessage="!! Internal Error !! - called enroll with invalid data"
  93. Const L_IntErrSCrdEnrlError_ErrorMessage="!! Internal Error !! - the template, CA, or CSP was rejected"
  94. Const L_Enrolling_Message="Enrolling..."
  95. Const L_EnrlErrNotEnoughReaders_ErrorMessage="You do not have enough smart card readers installed on this system. You must have one smart card available after the signing certificate is selected."
  96. Const L_EnrlErrInsertCard_ErrorMessage="Please insert the user's smart card."
  97. Const L_EnrlErrRemoveCard_ErrorMessage="The smart card has been removed, so that further communication is not possible."
  98. Const L_EnrlErrWrongCards_ErrorMessage="Too many smart cards of the same type are inserted. Please insert only one user smart card and try again."
  99. Const L_EnrlErrCryptoError_ErrorMessage="An error has occur while performing a cryptographic operation on the smart card. If this problem persists, try using a different smart card."
  100. Const L_EnrlErrNoSignCert_ErrorMessage="Cannot find the administrator signing smart card. Please insert the administrator smart card."
  101. Const L_EnrlErrCardCSPMismatch_ErrorMessage="The user smart card you inserted does not match the selected cryptographic service provider (CSP). Please insert a different smart card or select the appropriate CSP."
  102. Const L_EnrlErrCantEncode_ErrorMessage="The user's e-mail address cannot be encoded. The e-mail address may not contain extended characters."
  103. Const L_EnrlErrSECURITY_VIOLATION_ErrorMessage="Access was denied because of a security violation."
  104. Const L_EnrlErrCardCommunicate_ErrorMessage="A communications error with the smart card has been detected. Retry the operation."
  105. Const L_EnrlErrUnexpected_ErrorMessage="""An unexpected error occurred. Error: "" + sError"
  106. Const L_DispIncomplete_ErrorMessage="The certificate is not issued. CA incomplete error occurred. Please contact CA administrators."
  107. Const L_DispError_ErrorMessage="The certificate is not issued. CA issuing error occurred. Please contact CA administrators."
  108. Const L_DispDenied_ErrorMessage="The certificate is not issued. CA denied the request. Please contact CA administrators."
  109. Const L_DispOutofband_ErrorMessage="The certificate is not issued. CA required out of band policy. Please contact CA administrators."
  110. Const L_DispPending_ErrorMessage="The certificate is not issued because of pending. Smart Card Certificate Enrollment Station cannot handle pending request. Please select a template with no pending or contact CA administrators."
  111. Const L_DispRevoked_ErrorMessage="The certificate is not issued. CA revoked the certificate. Please contact CA administrators."
  112. '---------------------------------------------------------------------
  113. ' Set the dynamic status message and the state of the buttons, etc.
  114. Sub LoadControl(sContinueCmd)
  115. Dim sControlFileName, sCPU, sControl, chQuote
  116. ' determine the file name from the CPU type.
  117. sCPU=LCase(navigator.cpuClass)
  118. If 0<>strComp("x86", sCPU) And 0<>strComp("ia64", sCPU) Then
  119. AbortPage evalErrorMessage(L_BadCPU_ErrorMessage, sCPU)
  120. Exit Sub
  121. End If
  122. If Not g_fNewStation Then
  123. 'w2k or lower
  124. sCPU = "w2k"
  125. End If
  126. <%
  127. ' Determine the appropriate file version for scrdenrl. W2K clients will get the file version of scrdw2k.dll,
  128. ' all others will get the file version of scrdenrl.dll
  129. bUseNewControl = False
  130. sHttpUserAgent = Request.ServerVariables("HTTP_USER_AGENT")
  131. nIndex=InStr(sHttpUserAgent, "Windows NT 5.")
  132. If 0 <> nIndex Then
  133. If 0 < CInt(Right(Left(sHttpUserAgent, nIndex+13), 1)) Then
  134. 'newer than 5.0
  135. bUseNewControl = True
  136. End If
  137. End If
  138. If Not bUseNewControl Then
  139. sScrdEnrlVersion = sScrdW2KVersion
  140. End If
  141. %>
  142. ' load the control
  143. chQuote=chr(34)
  144. sControl="<Object " & vbNewline _
  145. & " ClassID=" & chQuote & "clsid:c2bbea20-1f2b-492f-8a06-b1c5ffeace3b" & chQuote & vbNewline _
  146. & " CodeBase=" & chQuote & "/CertControl/" + sCPU + "/scrdenrl.dll#Version=<%=sScrdEnrlVersion%>" & chQuote & vbNewline _
  147. & " ID=SCrdEnrl " & vbNewline _
  148. & "></Object>"
  149. 'Alert "About to create:" & vbNewline & sControl
  150. spnSCrdEnrl.innerHTML=sControl
  151. ' begin polling to see if the control is loaded
  152. setTimeout "LoadControlPhase2(" & chQuote & sContinueCmd & chQuote & ")", 1
  153. End Sub
  154. '---------------------------------------------------------------------
  155. ' Wait until the corntrol is loaded
  156. Function LoadControlPhase2(sContinueCmd)
  157. ' continued from above
  158. Dim chQuote, nResult, sErrorNumber, sErrorMessage
  159. chQuote=chr(34)
  160. 'Alert document.SCrdEnrl.readyState
  161. ' is the control loaded?
  162. If 4<>document.SCrdEnrl.readyState Then ' 4=READYSTATE_COMPLETE
  163. ' no, show a message and wait a while
  164. ShowTransientMessage(L_DownloadingControl_Message)
  165. setTimeout "LoadControlPhase2(" & chQuote & sContinueCmd & chQuote & ")", 500
  166. Else
  167. ' yes, hide the message and continue.
  168. HideTransientMessage
  169. ' smoke test the control
  170. nResult=ConfirmSCrdEnrlLoaded
  171. If 0<>nResult Then
  172. If 438=nResult Then
  173. sErrorMessage=L_ControlLoadFailed_ErrorMessage
  174. Else
  175. sErrorNumber="0x" & Hex(nResult)
  176. sErrorMessage=evalErrorMessage(L_ControlLoadFailedEx_ErrorMessage, sErrorNumber)
  177. End If
  178. AbortPage sErrorMessage
  179. Exit Function
  180. End If
  181. execScript sContinueCmd, "VBScript"
  182. End If
  183. End Function
  184. '-----------------------------------------------------------------
  185. ' Test to make sure SCrdEnrl loaded properly by calling a method on it.
  186. ' For best results, the method we call should only be available in the
  187. ' most recent version of the control, however any method will detect
  188. ' failure to create the object.
  189. Function ConfirmSCrdEnrlLoaded()
  190. On Error Resume Next
  191. Dim nTest
  192. nTest=document.SCrdEnrl.CSPCount
  193. ConfirmSCrdEnrlLoaded=Err.Number
  194. End Function
  195. '---------------------------------------------------------------------
  196. ' Set the dynamic status message and the state of the buttons, etc.
  197. Sub ChangePageStatusTo(eStatus)
  198. ' by default, hide everything
  199. spnRetry.style.display="none"
  200. spnViewCert.style.display="none"
  201. spnNewUser.style.display="none"
  202. spnEnroll.style.display="none"
  203. document.UIForm.btnSelectSigningCert.disabled=True
  204. document.UIForm.btnSelectUserName.disabled=True
  205. document.UIForm.btnRetry.disabled=True
  206. document.UIForm.btnViewCert.disabled=True
  207. document.UIForm.btnNewUser.disabled=True
  208. document.UIForm.btnEnroll.disabled=True
  209. document.UIForm.lbCertTemplate.disabled=True
  210. document.UIForm.lbCA.disabled=True
  211. document.UIForm.lbCSP.disabled=True
  212. If e_PageLoading=eStatus Then
  213. spnStatus.innerText=L_PageLoading_Message
  214. ElseIf e_ControlLoading=eStatus Then
  215. spnStatus.innerText=L_ControlLoading_Message
  216. ElseIf e_PageDead=eStatus Then
  217. spnStatus.innerText=evalErrorMessage(L_PageDead_ErrorMessage, g_sPageError)
  218. ElseIf e_PagePreEnroll=eStatus Then
  219. ' enable all the controls
  220. document.UIForm.lbCertTemplate.disabled=False
  221. If False=g_bTemplateBad Then
  222. document.UIForm.lbCA.disabled=False ' don't enable the CA box if there are no CAs
  223. End If
  224. document.UIForm.lbCSP.disabled=False
  225. document.UIForm.btnSelectSigningCert.disabled=False
  226. document.UIForm.btnSelectUserName.disabled=False
  227. ' set the status based upon what the user still must select
  228. If True=g_bUserNameBad Or True=g_bSigningCertBad Or True=g_bTemplateBad Or True=g_bCSPBad Then
  229. If True=g_bTemplateBad Then
  230. If True=g_bSigningCertBad Then
  231. If True=g_bUserNameBad Then
  232. spnStatus.innerText=L_MustSelect111_Message
  233. Else
  234. spnStatus.innerText=L_MustSelect110_Message
  235. End If
  236. Else
  237. If True=g_bUserNameBad Then
  238. spnStatus.innerText=L_MustSelect101_Message
  239. Else
  240. spnStatus.innerText=L_MustSelect100_Message
  241. End If
  242. End If
  243. ElseIf True = g_bCSPBad Then
  244. spnStatus.innerText=L_NoMatchedCSP_Message
  245. Else
  246. If True=g_bSigningCertBad Then
  247. If True=g_bUserNameBad Then
  248. spnStatus.innerText=L_MustSelect011_Message
  249. Else
  250. spnStatus.innerText=L_MustSelect010_Message
  251. End If
  252. Else
  253. spnStatus.innerText=L_MustSelect001_Message
  254. End If
  255. End If
  256. Else
  257. spnStatus.innerText=L_ReadyToEnroll_Message
  258. spnEnroll.style.display=""
  259. document.UIForm.btnEnroll.disabled=False
  260. End If
  261. ElseIf e_PageEnrolling=eStatus Then
  262. spnStatus.innerText=L_PageEnrolling_Message
  263. ElseIf e_PagePostEnrollOK=eStatus Then
  264. spnStatus.innerText=L_PagePostEnrollOK_Message
  265. spnViewCert.style.display=""
  266. document.UIForm.btnViewCert.disabled=False
  267. spnNewUser.style.display=""
  268. document.UIForm.btnNewUser.disabled=False
  269. ElseIf e_PagePostEnrollError=eStatus Or e_PagePostEnrollDisp=eStatus Then
  270. ' enable all the controls
  271. document.UIForm.lbCertTemplate.disabled=False
  272. If False=g_bTemplateBad Then
  273. document.UIForm.lbCA.disabled=False ' don't enable the CA box if there are no CAs
  274. End If
  275. document.UIForm.lbCSP.disabled=False
  276. document.UIForm.btnSelectSigningCert.disabled=False
  277. document.UIForm.btnSelectUserName.disabled=False
  278. If e_PagePostEnrollError=eStatus Then
  279. spnStatus.innerText=evalErrorMessage(L_PagePostEnrollError_ErrorMessage, g_sPageError)
  280. Else
  281. spnStatus.innerText=evalErrorMessage(L_PagePostEnrollDisp_ErrorMessage, g_sPageError)
  282. End If
  283. spnRetry.style.display=""
  284. document.UIForm.btnRetry.disabled=False
  285. spnNewUser.style.display=""
  286. document.UIForm.btnNewUser.disabled=False
  287. Else
  288. spnStatus.innerText=L_IntErrBadStatus_ErrorMessage
  289. End If
  290. End Sub
  291. Const SCARD_CTINFO_CSPLIST_FIRST=8
  292. Const SCARD_CTINFO_CSPLIST_NEXT=9
  293. '---------------------------------------------------------------------
  294. ' Populate the template list
  295. Function GetTemplateList
  296. On Error Resume Next
  297. Const SCARD_CTINFO_EXT_OID=3
  298. Const SCARD_CTINFO_ENROLLMENTFLAGS=11
  299. Const SCARD_CTINFO_RA_SIGNATURES=13
  300. Const CT_FLAG_PEND_ALL_REQUESTS=&H00000002
  301. Dim nIndex, sRealName, sDisplayName, nTemplateCount, oElem, bDefaultSet, nRequestedTemplateFlags
  302. Dim sCTEOid, nPendingFlags, fShowTemplate
  303. Dim sSmartCardCSPs, sCSP
  304. ShowTransientMessage L_RetrvTemplateList_Message
  305. nRequestedTemplateFlags=SCARD_ENROLL_USER_CERT_TEMPLATE Or SCARD_ENROLL_ENTERPRISE_CERT_TEMPLATE Or SCARD_ENROLL_CROSS_CERT_TEMPLATE
  306. ' get the number of available templates
  307. nTemplateCount=document.SCrdEnrl.getCertTemplateCount(nRequestedTemplateFlags)
  308. If 0<>Err.Number Then
  309. ' unexpected error
  310. GetTemplateList=Err.Number
  311. AddOption document.UIForm.lbCertTemplate, "(" & L_Unexpected_ErrorMessage & " 0x" & HEX(Err.Number) & ")", ""
  312. document.UIForm.lbCertTemplate.selectedIndex=0
  313. HideTransientMessage
  314. Exit Function
  315. ElseIf 0=nTemplateCount Then
  316. ' No templates found
  317. GetTemplateList=ERROR_NOITEMS 'our own error number
  318. AddOption document.UIForm.lbCertTemplate, L_NoTemplates_ErrorMessage, ""
  319. document.UIForm.lbCertTemplate.selectedIndex=0
  320. HideTransientMessage
  321. Exit Function
  322. End If
  323. If g_fNewStation Then
  324. 'get list of smart card csps
  325. For nIndex=1 To document.SCrdEnrl.CSPCount
  326. If 1 = nIndex Then
  327. sSmartCardCSPs = document.SCrdEnrl.enumCSPName(nIndex-1, FLAGS_NONE)
  328. End If
  329. If 1 <> nIndex Then
  330. sSmartCardCSPs = sSmartCardCSPs & "?" & document.SCrdEnrl.enumCSPName(nIndex-1, FLAGS_NONE)
  331. End If
  332. Next
  333. End If
  334. ' set the default template to be the first one which has a CA
  335. bDefaultSet=False
  336. ' loop over all the available templates and add them to the list box
  337. For nIndex=1 To nTemplateCount
  338. fShowTemplate = True
  339. ' add this template to the list box
  340. sRealName = document.SCrdEnrl.enumCertTemplateName(nIndex-1, nRequestedTemplateFlags Or SCARD_ENROLL_CERT_TEMPLATE_REAL_NAME)
  341. 'check to see if V2 template
  342. sCTEOid = document.ScrdEnrl.getCertTemplateInfo(sRealName, SCARD_CTINFO_EXT_OID)
  343. If "" <> sCTEOid Then
  344. 'check to see if pending
  345. nPendingFlags = document.ScrdEnrl.getCertTemplateInfo(sRealName, SCARD_CTINFO_ENROLLMENTFLAGS)
  346. nPendingFlags = CT_FLAG_PEND_ALL_REQUESTS And nPendingFlags
  347. If 0 <> nPendingFlags Then
  348. 'don't teake pending template
  349. fShowTemplate = False
  350. End If
  351. If True=fShowTemplate Then
  352. If 1 <> document.ScrdEnrl.getCertTemplateInfo(sRealName, SCARD_CTINFO_RA_SIGNATURES) Then
  353. fShowTemplate = False
  354. End If
  355. End If
  356. End If
  357. If g_fNewStation Then
  358. sCSP = Empty
  359. sCSP = document.SCrdEnrl.getCertTemplateInfo(sRealName, SCARD_CTINFO_CSPLIST_FIRST)
  360. If True = fShowTemplate And Not IsEmpty(sCSP) Then
  361. fShowTemplate = False
  362. 'check to see if any matched CSP
  363. While Not fShowTemplate And Not IsEmpty(sCSP)
  364. If 0 <> InStr(sSmartCardCSPs, sCSP) Then
  365. fShowTemplate = True
  366. End If
  367. If False = fShowTemplate Then
  368. sCSP = Empty
  369. sCSP = document.SCrdEnrl.getCertTemplateInfo(sRealName, SCARD_CTINFO_CSPLIST_NEXT)
  370. End If
  371. Wend
  372. End If
  373. End If
  374. If True = fShowTemplate Then
  375. sDisplayName=document.SCrdEnrl.enumCertTemplateName(nIndex-1, nRequestedTemplateFlags Or SCARD_ENROLL_CERT_TEMPLATE_DISPLAY_NAME)
  376. 'Alert "r:" & sRealName & " d:" & sDisplay Name
  377. AddOption document.UIForm.lbCertTemplate, sDisplayName, sRealName
  378. ' if we haven't set the default and this template has a CA, make it the default
  379. If False=bDefaultSet And 0<>document.SCrdEnrl.getCACount(sRealName) Then
  380. document.UIForm.lbCertTemplate.selectedIndex=nIndex-1
  381. bDefaultSet=True
  382. End If
  383. End If
  384. Next
  385. 'just select the first template
  386. document.UIForm.lbCertTemplate.selectedIndex=0
  387. ' we were successful
  388. GetTemplateList=0
  389. HideTransientMessage
  390. End Function
  391. '---------------------------------------------------------------------
  392. ' Populate the CSP list
  393. Function UpdateCSPList
  394. On Error Resume Next
  395. Dim nIndex, sName, nCSPCount, oElem
  396. Dim nListLength, sTemplateSupportedCSPs, sCSP, sCurrentTemplate
  397. 'init
  398. g_bCSPBad = False
  399. ShowTransientMessage L_RetrvCSPList_Message
  400. 'remove the current csp list
  401. nListLength=document.UIForm.lbCSP.Options.length
  402. For nIndex=1 To nListLength
  403. ' note that we keep deleting element 0 since
  404. ' the other options are automatically moved up one
  405. document.UIForm.lbCSP.Options.remove(0)
  406. Next
  407. ' get the number of available CSPs
  408. nCSPCount=document.SCrdEnrl.CSPCount
  409. If 0<>Err.Number Then
  410. ' unexpected error
  411. g_bCSPBad = True
  412. UpdateCSPList=Err.Number
  413. AddOption document.UIForm.lbCSP, "(" & L_Unexpected_ErrorMessage & " 0x" & HEX(Err.Number) & ")", ""
  414. document.UIForm.lbCSP.selectedIndex=0
  415. HideTransientMessage
  416. Exit Function
  417. ElseIf 0=nCSPCount Then
  418. ' No CSPs found
  419. g_bCSPBad = True
  420. UpdateCSPList=ERROR_NOITEMS
  421. AddOption document.UIForm.lbCSP, L_NoCSPs_ErrorMessage, ""
  422. document.UIForm.lbCSP.selectedIndex=0
  423. HideTransientMessage
  424. Exit Function
  425. End If
  426. If g_fNewStation Then
  427. 'template change, update csp list
  428. sTemplateSupportedCSPs = Empty
  429. sCurrentTemplate=document.UIForm.lbCertTemplate.value
  430. 'get csp list separated by ?
  431. sCSP = document.SCrdEnrl.getCertTemplateInfo(sCurrentTemplate, SCARD_CTINFO_CSPLIST_FIRST)
  432. While Not IsEmpty(sCSP)
  433. If IsEmpty(sTemplateSupportedCSPs) Then
  434. sTemplateSupportedCSPs = sCSP
  435. Else
  436. sTemplateSupportedCSPs = sTemplateSupportedCSPs & "?" & sCSP
  437. End If
  438. sCSP = Empty
  439. sCSP = document.SCrdEnrl.getCertTemplateInfo(sCurrentTemplate, SCARD_CTINFO_CSPLIST_NEXT)
  440. Wend
  441. End If
  442. ' loop over all the available CSPs and add them to the list box
  443. For nIndex=1 To nCSPCount
  444. sName=document.SCrdEnrl.enumCSPName(nIndex-1, FLAGS_NONE)
  445. If Not g_fNewStation Then
  446. AddOption document.UIForm.lbCSP, sName, sName
  447. End If
  448. If g_fNewStation Then
  449. If IsEmpty(sTemplateSupportedCSPs) Then
  450. AddOption document.UIForm.lbCSP, sName, sName
  451. End If
  452. If Not IsEmpty(sTemplateSupportedCSPs) Then
  453. If 0 <> InStr(stemplateSupportedCSPs, sName) Then
  454. AddOption document.UIForm.lbCSP, sName, sName
  455. End If
  456. End If
  457. End If
  458. Next
  459. If 0 = document.UIForm.lbCSP.Options.length Then
  460. ' No macthed CSP
  461. g_bCSPBad = True
  462. UpdateCSPList = ERROR_NOMATCHEDCSP
  463. AddOption document.UIForm.lbCSP, L_NoMatchedCSP_ErrorMessage, ""
  464. document.UIForm.lbCSP.selectedIndex = 0
  465. HideTransientMessage
  466. Exit Function
  467. End If
  468. 'set the default CSP selection
  469. document.UIForm.lbCSP.selectedIndex=0
  470. ' we were successful
  471. UpdateCSPList=0
  472. HideTransientMessage
  473. End Function
  474. '---------------------------------------------------------------------
  475. ' Update the CA list based upon the currently selected cert template
  476. Sub HandleTemplateChange
  477. On Error Resume Next
  478. Dim sCurrentTemplate, nListLength, nIndex, nCACount, sUniqueName, sDisplayName
  479. Dim nResult
  480. ShowTransientMessage L_RetrvCAList_Message
  481. sCurrentTemplate=document.UIForm.lbCertTemplate.value
  482. ' delete the current CA selection list
  483. nListLength=document.UIForm.lbCA.Options.length
  484. For nIndex=1 To nListLength
  485. ' note that we keep deleting element 0 since
  486. ' the other options are automatically moved up one
  487. document.UIForm.lbCA.Options.remove(0)
  488. Next
  489. 'update the CA list based on the CertType
  490. nCACount=document.SCrdEnrl.getCACount(sCurrentTemplate)
  491. If 0=nCACount Then
  492. AddOption document.UIForm.lbCA, L_NoCAs_ErrorMessage, ""
  493. g_bTemplateBad=True
  494. Else
  495. ' loop over all the available CAs and add them to the list box
  496. For nIndex=1 To nCACount
  497. sUniqueName=document.SCrdEnrl.enumCAName(nIndex-1, SCARD_ENROLL_CA_UNIQUE_NAME, sCurrentTemplate)
  498. sDisplayName=document.SCrdEnrl.enumCAName(nIndex-1, SCARD_ENROLL_CA_DISPLAY_NAME, sCurrentTemplate)
  499. 'alert "r:" & sRealName & " d:" & sDisplayName
  500. AddOption document.UIForm.lbCA, sDisplayName, sUniqueName
  501. Next
  502. g_bTemplateBad=False
  503. End If
  504. 'set the default CertType selection
  505. document.UIForm.lbCA.selectedIndex=0
  506. ' get the CSP list
  507. nResult=UpdateCSPList()
  508. ' make sure focus stays put
  509. document.UIForm.lbCertTemplate.focus
  510. If ERROR_NOMATCHEDCSP = nResult Then
  511. 'don't abort the page
  512. nResult = 0
  513. End If
  514. If 0<>nResult Then
  515. AbortPage evalErrorMessage(L_RetrvCSPList_ErrorMessage, "(0x" & HEX(nResult) & ")")
  516. Exit Sub
  517. End If
  518. HideTransientMessage
  519. ' refresh the state - may now be able to enroll
  520. ChangePageStatusTo e_PagePreEnroll
  521. End Sub
  522. '---------------------------------------------------------------------
  523. ' Create a new select option add it to the list box
  524. Sub AddOption(lbTarget, sText, sValue)
  525. Dim oElem
  526. Set oElem=document.createElement("Option")
  527. oElem.text=sText
  528. oElem.value=sValue
  529. lbTarget.Options.Add oElem
  530. End Sub
  531. '---------------------------------------------------------------------
  532. ' Indicate a catastrophic error and don't let the user do anything further
  533. Sub AbortPage(sMessage)
  534. g_sPageError=sMessage
  535. ChangePageStatusTo e_PageDead
  536. Alert sMessage
  537. End Sub
  538. '---------------------------------------------------------------------
  539. ' Show a transient message
  540. Sub ShowTransientMessage(sMessage)
  541. window.status=sMessage
  542. End Sub
  543. '---------------------------------------------------------------------
  544. ' Hide the last transient message
  545. Sub HideTransientMessage
  546. window.status=""
  547. End Sub
  548. '---------------------------------------------------------------------
  549. ' Set up everything after the page loads
  550. Sub PostLoad
  551. ' set the page status message and disable the controls
  552. ChangePageStatusTo e_ControlLoading
  553. ' set the page-global variables
  554. g_bUserNameBad=True
  555. g_bSigningCertBad=True
  556. g_bTemplateBad=True
  557. g_bCSPBad = True
  558. g_fNewStation = False
  559. Dim sUserAgent, nIndex
  560. sUserAgent=navigator.userAgent
  561. nIndex=InStr(sUserAgent, "Windows NT 5.")
  562. If 0 <> nIndex Then
  563. If 0 < CInt(Right(Left(sUserAgent, nIndex+13), 1)) Then
  564. 'newer than 5.0
  565. g_fNewStation = True
  566. End If
  567. End If
  568. ' load the ActiveX control
  569. LoadControl "PostLoadPhase2()"
  570. End Sub
  571. '---------------------------------------------------------------------
  572. ' set the status message and continue setting up
  573. Sub PostLoadPhase2
  574. ' set the page status message and disable the controls
  575. ChangePageStatusTo e_PageLoading
  576. ' allow IE to update the screen
  577. setTimeout "PostLoadPhase3", 1
  578. End Sub
  579. '---------------------------------------------------------------------
  580. ' Set up the CSP list and the template list
  581. Sub PostLoadPhase3
  582. On Error Resume Next
  583. Dim nResult
  584. ' get the template list
  585. nResult=GetTemplateList()
  586. If 0<>nResult Then
  587. If ERROR_NOITEMS=nResult Then
  588. AbortPage L_NoTemplatesLong_ErrorMessage
  589. Else
  590. AbortPage evalErrorMessage(L_RetrvTemplateList_ErrorMessage, "(0x" & HEX(nResult) & ")")
  591. End If
  592. Exit Sub
  593. End If
  594. ' update the CA list to reflect the currently selected template
  595. HandleTemplateChange
  596. ' set the default signing certificate
  597. If g_fNewStation Then
  598. document.SCrdEnrl.setSigningCertificate SCARD_SELECT_EKU, "1.3.6.1.4.1.311.20.2.1"
  599. Else
  600. document.SCrdEnrl.setSigningCertificate FLAGS_NONE, "EnrollmentAgent"
  601. End If
  602. ' ignore errors: if no default signing certificate, the user must pick one.
  603. Err.Clear
  604. ' make the page reflect the default signing certificate
  605. document.UIForm.tbSigningCert.value=document.SCrdEnrl.getSigningCertificateName(SCARD_ENROLL_NO_DISPLAY_CERT)
  606. g_bSigningCertBad=False
  607. If 0<>Err.Number Or ""=document.UIForm.tbSigningCert.value Then
  608. document.UIForm.tbSigningCert.value=L_NoCertSelected_Message
  609. g_bSigningCertBad=True
  610. End If
  611. ' finished setting up, enable controls
  612. ChangePageStatusTo e_PagePreEnroll
  613. End Sub
  614. '---------------------------------------------------------------------
  615. ' Select a signing certificate
  616. Sub SelectSigningCert
  617. On Error Resume Next
  618. ' ask SCrdEnrl to throw up UI to pick a signing cert
  619. If g_fNewStation Then
  620. document.SCrdEnrl.selectSigningCertificate SCARD_SELECT_EKU, "1.3.6.1.4.1.311.20.2.1"
  621. Else
  622. document.SCrdEnrl.selectSigningCertificate FLAGS_NONE, "EnrollmentAgent"
  623. End If
  624. 'check error but skip cancel
  625. If 0<>Err.Number And &H8010006E<>Err.Number And &H800704c7<>Err.Number Then
  626. Alert evalErrorMessage(L_SelectSignCert_ErrorMessage, "(0x" & HEX(Err.Number) & ")")
  627. End If
  628. ' make the page reflect what the user picked
  629. document.UIForm.tbSigningCert.value=document.SCrdEnrl.getSigningCertificateName(SCARD_ENROLL_NO_DISPLAY_CERT)
  630. g_bSigningCertBad=False
  631. If 0<>Err.Number Or ""=document.UIForm.tbSigningCert.value Then
  632. document.UIForm.tbSigningCert.value=L_NoCertSelected_Message
  633. g_bSigningCertBad=True
  634. End If
  635. ' refresh the state - may now be able to enroll
  636. ChangePageStatusTo e_PagePreEnroll
  637. End Sub
  638. '---------------------------------------------------------------------
  639. ' Select a user name
  640. Sub SelectUserName
  641. On Error Resume Next
  642. ' ask SCrdEnrl to throw up UI to pick a user
  643. document.SCrdEnrl.selectUserName(FLAGS_NONE)
  644. If 0<>Err.Number Then
  645. Alert evalErrorMessage(L_SelectUser_ErrorMessage, "(0x" & HEX(Err.Number) & ")")
  646. End If
  647. ' make the page reflect what the user picked
  648. document.UIForm.tbUserName.value=document.SCrdEnrl.getUserName(SCARD_ENROLL_UPN_NAME)
  649. If 0<>Err.Number Then
  650. 'If we can not get the UPN name, get the SAM compatible name
  651. Err.Clear
  652. document.UIForm.tbUserName.value=document.SCrdEnrl.getUserName(SCARD_ENROLL_SAM_COMPATIBLE_NAME)
  653. End If
  654. g_bUserNameBad=False
  655. If 0<>Err.Number Or ""=document.UIForm.tbUserName.value Then
  656. document.UIForm.tbUserName.value=L_NoUserSelected_Message
  657. g_bUserNameBad=True
  658. End If
  659. ' refresh the state - may now be able to enroll
  660. ChangePageStatusTo e_PagePreEnroll
  661. End Sub
  662. '---------------------------------------------------------------------
  663. ' Verify all the user input and begin the enrollment process
  664. Sub Enroll
  665. On Error Resume Next
  666. Dim sTemplateName, sCAName, sCSPName, UserName, LenResult
  667. ' check to make sure all the fields are OK
  668. If True=g_bUserNameBad Or True=g_bSigningCertBad Or True=g_bTemplateBad Or True = g_bCSPBad Then
  669. AbortPage L_IntErrBadData_ErrorMessage
  670. Exit Sub
  671. End If
  672. ' tell SCrdEnrl what the user picked from the list boxes
  673. ' these should all be OK, since SCrdEnrl gave us these options
  674. ' set the template
  675. sTemplateName=document.UIForm.lbCertTemplate.value
  676. document.SCrdEnrl.setCertTemplateName SCARD_ENROLL_CERT_TEMPLATE_REAL_NAME, sTemplateName
  677. ' set the CA name
  678. sCAName=document.UIForm.lbCA.value
  679. document.SCrdEnrl.setCAName SCARD_ENROLL_CA_UNIQUE_NAME, sTemplateName, sCAName
  680. ' set the CSP
  681. sCSPName=document.UIForm.lbCSP.value
  682. document.SCrdEnrl.CSPName=sCSPName
  683. ' make sure SCrdEnrl is still happy so far
  684. If 0<>Err.Number Then
  685. AbortPage L_IntErrSCrdEnrlError_ErrorMessage
  686. Exit Sub
  687. End If
  688. ' signing cert is already set
  689. ' user name is already set
  690. ' everything looks great
  691. ' change the status
  692. ChangePageStatusTo e_PageEnrolling
  693. ShowTransientMessage L_Enrolling_Message
  694. ' give IE time to repaint the screen, then continue enrolling
  695. setTimeout "EnrollPhase2", 1
  696. End Sub
  697. '---------------------------------------------------------------------
  698. ' Finish the enrollment process
  699. Sub EnrollPhase2
  700. On Error Resume Next
  701. Const CR_DISP_INCOMPLETE =0
  702. Const CR_DISP_ERROR =1
  703. Const CR_DISP_DENIED =2
  704. Const CR_DISP_ISSUED =3
  705. Const CR_DISP_ISSUED_OUT_OF_BAND=4
  706. Const CR_DISP_UNDER_SUBMISSION =5
  707. Const CR_DISP_REVOKED =6
  708. Dim nDisposition
  709. Dim EnrollErr, sErrDescription
  710. ' actually do the enrollment
  711. document.SCrdEnrl.enroll(FLAGS_NONE)
  712. EnrollErr = Err.Number
  713. If 0 <> EnrollErr Then
  714. sErrDescription = Err.Description
  715. End If
  716. If g_fNewStation Then
  717. nDisposition = document.ScrdEnrl.EnrollmentStatus
  718. Else
  719. nDisposition = CR_DISP_ISSUED
  720. End If
  721. ' check for errors
  722. If 0=EnrollErr And CR_DISP_ISSUED=nDisposition Then
  723. ' No errors. Yay!
  724. ChangePageStatusTo e_PagePostEnrollOK
  725. ElseIf 0=EnrollErr And CR_DISP_ISSUED<>nDisposition Then
  726. 'cert is not issued for some reasons
  727. If CR_DISP_INCOMPLETE=nDisposition Then
  728. g_sPageError=L_DispIncomplete_ErrorMessage
  729. ElseIf CR_DISP_ERROR=nDisposition Then
  730. g_sPageError=L_DispError_ErrorMessage
  731. ElseIf CR_DISP_DENIED=nDisposition Then
  732. g_sPageError=L_DispDenied_ErrorMessage
  733. ElseIf CR_DISP_ISSUED_OUT_OF_BAND=nDisposition Then
  734. g_sPageError=L_DispOutofband_ErrorMessage
  735. ElseIf CR_DISP_UNDER_SUBMISSION=nDisposition Then
  736. g_sPageError=L_DispPending_ErrorMessage
  737. ElseIf CR_DISP_REVOKED=nDisposition Then
  738. g_sPageError=L_DispRevoked_ErrorMessage
  739. End If
  740. 'not issued
  741. ChangePageStatusTo e_PagePostEnrollDisp
  742. Alert g_sPageError
  743. Else
  744. ' ERROR:
  745. ' determine what went wrong, by known error numbers
  746. Dim sError, fCancel
  747. fCancel = False
  748. sError=Hex(EnrollErr)
  749. If 0=strComp(sError, "80100017") Then
  750. g_sPageError=L_EnrlErrNotEnoughReaders_ErrorMessage
  751. ElseIf 0=strComp(sError, "8010000C") Then
  752. g_sPageError=L_EnrlErrInsertCard_ErrorMessage
  753. ElseIf 0=strComp(sError, "80070004") Then
  754. g_sPageError=L_EnrlErrWrongCards_ErrorMessage
  755. ElseIf 0=strComp(sError, "8010001C") Then
  756. g_sPageError=L_EnrlErrCryptoError_ErrorMessage
  757. ElseIf 0=strComp(sError, "8010002C") Then
  758. g_sPageError=L_EnrlErrNoSignCert_ErrorMessage
  759. ElseIf 0=strComp(sError, "8010000F") Then
  760. g_sPageError=L_EnrlErrCardCSPMismatch_ErrorMessage
  761. ElseIf 0=strComp(sError, "80100069") Then
  762. g_sPageError=L_EnrlErrRemoveCard_ErrorMessage
  763. ElseIf 0=strComp(sError, "80092022") Then
  764. g_sPageError=L_EnrlErrCantEncode_ErrorMessage
  765. ElseIf 0=strComp(sError, "8010002F") Then
  766. g_sPageError=L_EnrlErrCardCommunicate_ErrorMessage
  767. ElseIf 0=strComp(sError, "8010006A") Then
  768. g_sPageError=L_EnrlErrSECURITY_VIOLATION_ErrorMessage
  769. ElseIf 0=strComp(sError, "8010006E") Or 0=strComp(sError, "800704C7") Then
  770. 'skip cancel
  771. fCancel = True
  772. Else
  773. g_sPageError=evalErrorMessage(L_EnrlErrUnexpected_ErrorMessage, "(0x" & sError & ")." & vbNewLine & sErrDescription)
  774. End If
  775. If fCancel Then
  776. ChangePageStatusTo e_PagePreEnroll
  777. Else
  778. ' Throw an alert box and change the page to show the error
  779. ChangePageStatusTo e_PagePostEnrollError
  780. Alert g_sPageError
  781. End If
  782. End If
  783. HideTransientMessage
  784. End Sub
  785. '---------------------------------------------------------------------
  786. ' View the enrolled certificate
  787. Sub ViewCert
  788. On Error Resume Next
  789. document.SCrdEnrl.getEnrolledCertificateName(SCARD_ENROLL_DISPLAY_CERT)
  790. End Sub
  791. '---------------------------------------------------------------------
  792. ' Reset a new user
  793. Sub NewUser
  794. On Error Resume Next
  795. ' get rid of the old user name
  796. document.SCrdEnrl.resetUser()
  797. document.UIForm.tbUserName.value=L_NoUserSelected_Message
  798. g_bUserNameBad=True
  799. ' refresh the state
  800. ChangePageStatusTo e_PagePreEnroll
  801. End Sub
  802. </Script>
  803. <Script Language="JavaScript">
  804. //--------------------------------------------------------------------
  805. // perform substitution on the error string, because VBScript cannot
  806. function evalErrorMessage(sMessage, sError) {
  807. return eval(sMessage);
  808. }
  809. </Script>
  810. </Head>
  811. <Body Language="VBScript" OnLoad="PostLoad" BgColor=#FFFFFF Link=#0000FF VLink=#0000FF ALink=#0000FF><Font ID=locPageFont Face="Arial">
  812. <Table Border=0 CellSpacing=0 CellPadding=4 Width=100% BgColor=#008080>
  813. <TR>
  814. <TD><Font Color=#FFFFFF><LocID ID=locMSCertSrv><Font Face="Arial" Size=-1><B><I>Microsoft</I></B> Certificate Services</Font></LocID></Font></TD>
  815. <TD ID=locHomeAlign Align=Right><A Href="/certsrv"><Font Color=#FFFFFF><LocID ID=locHomeLink><Font Face="Arial" Size=-1><B>Home</B></Font></LocID></Font></A></TD>
  816. </TR>
  817. </Table>
  818. <P ID=locPageTitle> <B> Smart Card Certificate Enrollment Station </B>
  819. <!-- Green HR --><Table Border=0 CellSpacing=0 CellPadding=0 Width=100%><TR><TD BgColor=#008080><Img Src="certspc.gif" Alt="" Height=2 Width=0></TD></TR></Table>
  820. <Form Name=UIForm>
  821. <Table Border=0 Width=100%>
  822. <!-- subheading -->
  823. <TR><TD Colspan=2>
  824. <Table Border=0 CellPadding=0 CellSpacing=0 Width=100%>
  825. <TR><TD ID=locOptHead><Font Size=-1><B>Enrollment Options:</B></Font></TD></TR>
  826. <TR><TD Height=2 BgColor=#008080></TD></TR>
  827. </Table>
  828. </TD></TR>
  829. <TR>
  830. <TD ID=locTemplateLabel Align=Right><Font Size=-1><Label For=lbCertTemplateID><locID ID=locTemplateLabel>Certificate Template:</locID></Label></Font></TD>
  831. <TD><Select Name=lbCertTemplate ID=lbCertTemplateID OnChange="HandleTemplateChange" Language="VBScript"></Select></TD>
  832. </TR>
  833. <TR>
  834. <TD ID=locCALabel Align=Right><Font Size=-1><Label For=lbCAID><locID ID=locCALabel>Certification Authority:</locID></Label></Font></TD>
  835. <TD><Select Name=lbCA ID=lbCAID></Select></TD>
  836. </TR>
  837. <TR>
  838. <TD ID=locCSPLabel Align=Right><Font Size=-1><Label For=lbCSPID><locID ID=locCSPLabel>Cryptographic <BR>Service Provider:</locID></Label></Font></TD>
  839. <TD><Select Name=lbCSP ID=lbCSPID></Select></TD>
  840. </TR>
  841. <TR>
  842. <TD ID=locSigningCertLabel Align=Right><Font Size=-1><Label For=locTbSigningCert><locID ID=locSigningCertLabel>Administrator <BR>Signing Certificate:</locID></Label></Font></TD>
  843. <TD><Input ID=locTbSigningCert Type=Text Size=45 Name=tbSigningCert ReadOnly Disabled Value="(No certificate selected)" Title="Please click on the Select Certificate button to select a signing certificate">
  844. <Input ID=locBtnSelectSigningCert Type=Button Name=btnSelectSigningCert Value="Select Certificate..." OnClick="SelectSigningCert" Language="VBScript"></TD>
  845. </TR>
  846. <!-- subheading -->
  847. <TR><TD ColSpan=2>
  848. <Table Border=0 CellPadding=0 CellSpacing=0 Width=100%>
  849. <TR><TD ID=locUserHead><Font Size=-1><BR><B>User To Enroll:</B></Font></TD></TR>
  850. <TR><TD Height=2 BgColor=#008080></TD></TR>
  851. </Table>
  852. </TD></TR>
  853. <TR>
  854. <TD ID=locUsrAlign Align=Right></TD>
  855. <TD><Input ID=locTbUserName Type=Text Size=45 Name=tbUserName ReadOnly Disabled Value="(No user selected)" Title="Please click on the Select User button to select a user">
  856. <Input ID=locBtnSelectUserName Type=Button Name=btnSelectUserName Value="Select User..." OnClick="SelectUserName" Language="VBScript"></TD>
  857. </TR>
  858. </Table>
  859. <!-- status area -->
  860. <Table Border=0 CellPadding=0 CellSpacing=0 Width=100%>
  861. <TR><TD ID=locStatusHead><Font Size=-1><BR><B>Status:</B></Font></TD></TR>
  862. <TR><TD Height=2 BgColor=#008080></TD></TR>
  863. </Table>
  864. <P><Span ID=spnStatus></Span></P>
  865. <!-- Green HR --><Table Border=0 CellSpacing=0 CellPadding=0 Width=100%><TR><TD BgColor=#008080><Img Src="certspc.gif" Alt="" Height=2 Width=0></TD></TR></Table>
  866. <!-- White HR --><Table Border=0 CellSpacing=0 CellPadding=0 Width=100%><TR><TD BgColor=#FFFFFF><Img Src="certspc.gif" Alt="" Height=5 Width=0></TD></TR></Table>
  867. <Table Width=100% Border=0 CellPadding=0 CellSpacing=0><TR><TD ID=locButtonAlign Align=Right>
  868. <Span ID=spnRetry Style="display:none">
  869. <LocID><Input ID=locBtnRetry Type=Button Name=btnRetry Value="Retry" OnClick="Enroll" Language="VBScript">
  870. &nbsp;</LocID>
  871. </Span>
  872. <Span ID=spnViewCert Style="display:none">
  873. <LocID><Input ID=locBtnViewCert Type=Button Name=btnViewCert Value="View Certificate" OnClick="ViewCert" Language="VBScript">
  874. &nbsp;</LocID>
  875. </Span>
  876. <Span ID=spnNewUser Style="display:none">
  877. <LocID><Input ID=locBtnNewUser Type=Button Name=btnNewUser Value="New User" OnClick="NewUser" Language="VBScript">
  878. &nbsp;</LocID>
  879. </Span>
  880. <Span ID=spnEnroll Style="display:none">
  881. <LocID><Input ID=locBtnEnroll Type=Button Name=btnEnroll Value="Enroll" OnClick="Enroll" Language="VBScript">
  882. &nbsp;</LocID>
  883. </Span>
  884. <LocID ID=locSpc1>&nbsp;&nbsp;&nbsp;&nbsp;<LocID>
  885. </TD></TR></Table>
  886. <Span ID=spnSCrdEnrl Style="display:none"><!-- The control will be placed here --></Span>
  887. </Form>
  888. </Font>
  889. </Body>
  890. </HTML>