EldoS | Feel safer!

Software components for data protection, secure storage and transfer

I have a problem with Certificates in Compact Framework

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#2205
Posted: 02/08/2007 05:48:52
by net36854  (Basic support level)
Joined: 01/17/2007
Posts: 6

CreatefromCertFile is a component of .Net Framework when use the System.Security.Cryptography.X509Certificates
This component read a Certificate saved from certmanager of windows in format DER binary X.509(.CER file) and the component ClientCertificate use this public part of certificate file to sign the conection to webservices.

.
#8666
Posted: 01/16/2009 17:56:40
by net36854  (Basic support level)
Joined: 01/17/2007
Posts: 6

Hello,

I here again. Now I have a Destop Applicattion that use this code to access to Certificate content manager to ask about the certainly certificates are installed. When found one certificate with complaint the credential, the application sign a transsaction with this certificate. But now i need integrated this posibilitie in the Mobile application and i don't have idea if is possible with SBB make easily a similar function.

Code:

Public cert As System.Security.Cryptography.X509Certificates.X509Certificate
Public StoreCerts As X509Store = New X509Store(StoreLocation.CurrentUser)
.
.
.
.
cert = Read_certificate(0)
.
.
XMLSend.ClientCertificates.Add(cert)
XMLSend.execute(XMLFile)
.
.

Public Function Read_certificate(ByVal index As Integer) As X509Certificate
Dim counter As Integer
counter = 0
StoreCerts.Open(OpenFlags.ReadOnly)
colection = StoreCerts.Certificates
If colection.Count < 1 Then
MsgBox("Don't Found Certificates")
End If
ListBox1.Items.Clear()
XMLSend.ClientCertificates.Clear()

Dim cn As String
If RadioButton5.Checked = True Then cn = "CN=My Partner" Else cn = "CN=Partner Group"
For Each count As X509Certificate In coleccion
If count.Issuer.StartsWith(cn) And count.Subject.Contains("Partner") <> True Then
ListBox1.Items.Add(count.Subject)
If counter = index Then
XMLSend.ClientCertificates.Clear()
Return count
End If
counter +=1
End If
Next
Return Nothing
End Function
#8667
Posted: 01/17/2009 00:14:58
by Ken Ivanov (EldoS Corp.)

Please use TElWinCertStorage to access system certificates. Translating your code,

dim store as TElWinCertStorage = new TElWinCertStorage()
store.AccessType = TSBStorageAccessType.CurrentUser
store.ReadOnly = true
store.SystemStores.Add("MY")
for i = 0 to store.Count - 1
if RadioButton5.Checked = True Then cn = "My Partner" Else cn = "Partner Group"
if store.Certificates(i).IssuerName.CommonName.StartsWith(cn) And
store.Certificates(i).SubjectName.CommonName.Contains("Partner") <> True then
...
end if
next

Reply

Statistics

Topic viewed 6488 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!