I have made web application using asp.net and
vb.net for making digital signature in the pdf
i am using x509store for getting all certificates from the windows certificates root. but its not function afte deploy in iis 7.5. getting exception
" current Session interactive"
my function is given below for getting x509ceritificates
Public Function GetCertificate() As X509Certificate2
Dim st As New X509Store(StoreName.My, StoreLocation.LocalMachine)
st.Open(OpenFlags.[ReadOnly])
Dim col As X509Certificate2Collection = st.Certificates
Dim card As X509Certificate2 = Nothing
Dim fcollection As X509Certificate2Collection = col.Find(X509FindType.FindByTimeValid, DateTime.Now, False).Find(X509FindType.FindByKeyUsage, X509KeyUsageFlags.DigitalSignature, False)
Dim sel As X509Certificate2Collection = X509Certificate2UI.SelectFromCollection(fcollectio n, "Certificates", "Select one to sign", X509SelectionFlag.SingleSelection)
sel.Add(fcollection(0))
'Dim sel As X509Certificate2Collection = X509Certificate2UI.SelectFromCollection(col, "Certificates", "Select one to sign", X509SelectionFlag.SingleSelection)
sel.Add(col(0))
If sel.Count > 0 Then
Dim en As X509Certificate2Enumerator = sel.GetEnumerator()
en.MoveNext()
card = New X509Certificate2(en.Current.RawData)
card = en.Current
End If
st.Close()
Return card
End Function
plz resolve the problem
Thanx