EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Search for issuer in storage

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
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 (Team)

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 446 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!