Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/06/2016, 08:43
Avatar de Drako_18
Drako_18
 
Fecha de Ingreso: mayo-2005
Ubicación: Madrid
Mensajes: 505
Antigüedad: 19 años
Puntos: 16
Respuesta: ¿Cómo acceder a los certificados instalados en mi browser?

Buenas compañero,

Desde WinForm, ayer probé a hacer algo así:
Código vb:
Ver original
  1. Dim x509Store As New X509Store(StoreName.My, StoreLocation.CurrentUser)
  2.         x509Store.Open(OpenFlags.[ReadOnly])
  3.  
  4.         Dim certSelected As X509Certificate2 = Nothing
  5.         Dim col As X509Certificate2Collection = x509Store.Certificates '.Find(X509FindType.FindByIssuerName, "Ceres", True)
  6.  
  7.         Dim sel As X509Certificate2Collection = X509Certificate2UI.SelectFromCollection(col, "windowTitle", "windowMsg", X509SelectionFlag.SingleSelection)
  8.  
  9.         If sel.Count > 0 Then
  10.             Dim en As X509Certificate2Enumerator = sel.GetEnumerator()
  11.             en.MoveNext()
  12.             certSelected = en.Current
  13.         End If
  14.  
  15.  
  16.         x509Store.Close()


Espero que te pueda ayudar, un saludo!!!
PD: Probé a firmar, pero no puedo firmar... Si lo encuentras, avísa..!
__________________
Rubén Espada
Desarrollador full stack .Net (Angular + JS + .Net Core)