EldoS
Navigation
Web site
Support
Table Of Contents

Search for certificates in the storage

To find one or more certificate in the storage by some criteria, you need to use an instance of TElCertificateLookup class and FindFirst() and FindNext() methods of TElCustomCertStorage option.

First, create an instance of TElCertificateLookup class.

Next, you need to setup search criteria. To do this

  1. Set the values, which the certificate must have, to one or more of IssuerRDN, SubjectRDN, ValidFrom, ValidTo, PublicKeyAlgorithm, SignatureAlgorithm, PublicKeySizeMin, PublicKeySizeMax, AuthorityKeyIdentifier, SubjectKeyIdentifier, KeyUsage, EmailAddresses, SerialNumber properties of TElCertificateLookup object.
  2. Tell the TElCertificateLookup object, what properties you want to use for search with help of Criteria property.
  3. If you want to search by date, set DateLookupOptions property.
  4. If you want to search by key size, set KeySizeLookupOption property
  5. If you want to search by key usage, set KeyUsageLookupOptions property

After you setup the criteria, you need to setup global lookup options using Options property of TElCertificateLookup object.

Finally, do the actual search by calling FindFirst() method of TElX509Certificate to locate first certificate, that matches the given criteria. If the certificate is located, FindFirst() method returns the index of the certificate. If the certificate could not be found, FindFirst() method returns -1. Use FindNext() method if needed to locate the consequent certificates that match the criteria.

After you get the index of the certificate, use the Certificates[] property of of TElCustomCertStorage class to access the certificate itself.

 
Contact Us | Terms of Use | Trademarks | Privacy Statement
Copyright (c) 1998-2012, EldoS Corporation