Lecture du certificate store impossible apres publication
Bonjour à tous,
J'ai le code suivant qui me permet d'afficher dans une textbox les infos des certificats contenue dans le store du user actuellement connecté à l'application.
En mode debug, tout fonctionne bien, mais une fois publier sur mon IIS 7.5, le nombre de certificat lisible est égale à 0 alors que j'utilise le meme browser...
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
Dim x509Store As New X509Store(StoreName.My, StoreLocation.CurrentUser)
' create and open store for read-only access
Try
x509Store.Open(OpenFlags.MaxAllowed)
Catch ex As Exception
TextBox1.Text = ex.Message
End Try
TextBox1.Text = x509Store.Certificates.Count
' search store
' Dim col As New X509Certificate2Collection
' col = x509Store.Certificates.Find(X509FindType.FindByIssuerName, "SSO_CA", True)
For Each cert In x509Store.Certificates
'Print to console the information contained in the certificate.
TextBox1.Text = TextBox1.Text & cert.Subject
TextBox1.Text = TextBox1.Text & cert.Issuer
TextBox1.Text = TextBox1.Text & cert.Version
TextBox1.Text = TextBox1.Text & cert.NotBefore
TextBox1.Text = TextBox1.Text & cert.NotAfter
TextBox1.Text = TextBox1.Text & cert.Thumbprint
TextBox1.Text = TextBox1.Text & cert.SerialNumber
TextBox1.Text = TextBox1.Text & cert.PublicKey.Oid.FriendlyName
TextBox1.Text = TextBox1.Text & cert.PublicKey.EncodedKeyValue.Format(True)
TextBox1.Text = TextBox1.Text & cert.RawData.Length
TextBox1.Text = TextBox1.Text & cert.ToString(True)
TextBox1.Text = TextBox1.Text & cert.PublicKey.Key.ToXmlString(False)
Next
x509Store.Close() |
Quelqu'un peut-il m'expliquer pourquoi ?
Merci d'avance.
DeWaRs
Edit : Si je change le storelocation pour lire la localmachine, je peux lire les certificat dans les deux cas.