Here is my sample code from Visual Studio 2005 with the full Framework which
is working fine. My problem is to port this code to my Device-project.
Dim x As New TestWebService
Dim store As X509Certificates.X509Store = New
X509Certificates.X509Store(X509Certificates.StoreName.My)
store.Open(X509Certificates.OpenFlags.MaxAllowed)
Dim mycollection As X509Certificates.X509CertificateCollection =
store.Certificates
Dim cert As Security.Cryptography.X509Certificates.X509Certificate
For Each cert In mycollection
If cert.Subject.Substring(0, 7) = "CN=Test" Then
x.ClientCertificates.Add(cert)
Exit For
End If
Next
mycollection.Clear()
mycollection = Nothing
store.Close()
store = Nothing
x.Url = "
https://PDA.Test.com"
Here is my new code for my Device-project :
Dim x As New TestWebService
Dim store As
InTheHand.Security.Cryptography.X509Certificates.X509Store = New
InTheHand.Security.Cryptography.X509Certificates.X509Store(InTheHand.Securit
y.Cryptography.X509Certificates.StoreName.My)
store.Open(InTheHand.Security.Cryptography.X509Certificates.OpenFlags.MaxAll
owed)
Dim mycollection As
InTheHand.Security.Cryptography.X509Certificates.X509CertificateCollection =
store.Certificates
Dim cert As Security.Cryptography.X509Certificates.X509Certificate
For Each cert In mycollection
If cert.GetName.Substring(0, 7) = "CN=Test" Then
x.ClientCertificates.Add(cert)
'This is not working in the Compact Framework 1.0/2.0
Exit For
End If
Next
mycollection = Nothing
store.Close()
store = Nothing
x.Url = "
https://PDA.Test.com"
How to make this work on my Device ?
Best regards
Kay