%@ CODEPAGE=65001 'UTF-8%> <%' certrqma.asp - (CERT)srv web - (R)e(Q)uest, (M)ore (A)dvanced ' Copyright (C) Microsoft Corporation, 1998 - 1999 %> <% On Error Resume Next ' Exporting keys to a pvk file is only used by old code signing tools. ' (This is different from exporting both cert and keys in a pfx file.) ' Set this flag to true if you really need this functionality bEnableExportKeyToFile = True Const CR_OUT_BASE64 =&H00000001 Const CR_PROP_CAEXCHGCERT=15 Const PROPTYPE_BINARY=3 ' get CA exchange cert and save into this page Dim bFailed, nError Set ICertRequest2=Server.CreateObject("CertificateAuthority.Request") bFailed=False If "IE"=sBrowser Then Public sCAExchangeCert Dim sCertificate sCertificate=ICertRequest2.GetCAProperty(sServerConfig, CR_PROP_CAEXCHGCERT, 0, PROPTYPE_BINARY, CR_OUT_BASE64) sCAExchangeCert=FormatBigString(sCertificate, " sCAExchange=sCAExchange & ") End If If Err.Number<>0 Then ' CA may be down. bFailed=True nError=Err.Number End If '----------------------------------------------------------------- ' Format the big string as a concatenated VB string, breaking at the embedded newlines Function FormatBigString(sSource, sLinePrefix) Dim sResult, bCharsLeft, nStartChar, nStopChar, chQuote sResult="" chQuote=chr(34) bCharsLeft=True nStopChar=1 While (bCharsLeft) nStartChar=nStopChar nStopChar=InStr(nStopChar, sSource, vbNewLine) If (nStopChar>0) Then sResult=sResult & sLinePrefix & chQuote & Mid(sSource, nStartChar, nStopChar-nStartChar) & chQuote & " & vbNewLine" If (nStopChar>=Len(sSource)-Len(vbNewLine)) Then bCharsLeft=False End If Else bCharsLeft=False End if sResult=sResult & vbNewLine nStopChar=nStopChar+Len(vbNewLine) Wend FormatBigString=sResult End Function %>
Error
An unexpected error has occurred:
<%If nError=&H800706BA Or nError=&H80070005 Then%>