Salve a tutti.
Ho una bella funzioncina che mi legge i dati da una Smart Card. La funzione è in VBScript ma naturalmente non funziona non Mozilla Firefox.
Ho provato a tradurre qualcosina ma ho qualche problema con i certificati...

codice:
<script language="vbscript">
	function Lettura()
		On Error Resume Next 
		Dim count
		dim Certificato, conteggio, tutto
		Dim LunghezzaCertificato, uscita
		Dim st,i,j
		certificato=""
		conteggio=0
		set st = CreateObject("CAPICOM.Store")
		st.Open 4
		conteggio = st.certificates.count
		if conteggio >= 1 Then
			Certificato= st.Certificates(1).subjectName
			tutto=st.Certificates(1).subjectName
			LunghezzaCertificato= len(trim(Certificato))
			j=0
			for i = 1 to LunghezzaCertificato
				if mid(Certificato,i,1) = "/" then
					if j>0 then
						exit for
					end if
					j=i
				end if
			next
			Certificato=mid(Certificato,i+1,16)
			window.location.href="ok.asp"
		else
			msgbox "Smart Card Non Presente" , 16 , "Attenzione!"
			top.window.location.href="Main.htm"
		end if
	end function        

</script>