EldoS | Feel safer!

Software components for data protection, secure storage and transfer

I have a problem with Certificates in Compact Framework

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.

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


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.


Public cert As System.Security.Cryptography.X509Certificates.X509Certificate
Public StoreCerts As X509Store = New X509Store(StoreLocation.CurrentUser)
cert = Read_certificate(0)

Public Function Read_certificate(ByVal index As Integer) As X509Certificate
Dim counter As Integer
counter = 0
colection = StoreCerts.Certificates
If colection.Count < 1 Then
MsgBox("Don't Found Certificates")
End If

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
If counter = index Then
Return count
End If
counter +=1
End If
Return Nothing
End Function
Posted: 01/17/2009 00:14:58
by Ken Ivanov (Team)

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

dim store as TElWinCertStorage = new TElWinCertStorage()
store.AccessType = TSBStorageAccessType.CurrentUser
store.ReadOnly = true
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



Topic viewed 6881 times

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


Back to top

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

Got it!