EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Search for issuer in storage

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
Posted: 09/25/2014 10:22:32
by Martin ANDRES (Standard support level)
Joined: 09/25/2014
Posts: 18

I would like to search the ROOT storage to check the presence of a certain certificate.
To do that I have written the following source code:

WinStorageROOT := TElWinCertStorage.Create(nil);

certificateLookup := TElCertificateLookup.Create(nil);
//certificateLookup.Criteria := [lcEmail];
certificateLookup.Criteria := [lcIssuer];

issuerRDN := TElRelativeDistinguishedName.Create;
issuerRDN.LoadFromDNString('/C=AR/ST=BS AS/L=La Plata/O=Ministerio P├║blico/OU=MPBA/CN=MPBA CA/E=postmaster@mpba.gov.ar', true);


certificateIndex := WinStorageROOT.FindFirst(certificateLookup);

if certificateIndex = -1 then
           ShowMessage('The certicate doesn't exist');

I always get certificateIndex = -1 but if I do the search using email the certificate is found.

What am I doing wrong?

I attach the certificate that I'm trying to find. It's a crt file but I've changed the extension to txt.

I'll appreciate your help.

Thanks and regards,

[ Download ]
Posted: 09/26/2014 03:09:31
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

Try to add next option to TElCertificateLookup.Options property:

Lookup.Options := Lookup.Options + [loCompareRDNAsStrings];

and check if this helps.
Posted: 09/26/2014 06:09:25
by Martin ANDRES (Standard support level)
Joined: 09/25/2014
Posts: 18


That property makes it work.

Thanks a lot for your help.




Topic viewed 363 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!