c - How to get next certificate in chain -


i want parent certificate (or certificates in chain matter) windows certificate store (assuming know location of end certificate). need each 1 in order build own custom x509_store (using openssl).

i think proper course of action be:

  1. obtain first certificate using certfindcertificateinstore (done)
  2. get certificate chain using certgetcertificatechain (done)
  3. extract certificates chain (?)
  4. for each certificate in chain, convert using d2i_x509 (done)

or

  1. obtain first certificate using certfindcertificateinstore (done)
  2. get parent certificate (if exists) (?)
  3. convert using d2i_x509, go 2. (done)

then create store.

the question answer - how parent certificate or certificates in chain using windows certificate store? i'm missing more or less occult function here.

as certfindcertificateinstore outputs chain context, 1 can access it's members using beautiful construction:

chaincontext->rgpchain[0]->rgpelement[icertindex]->pcertcontext->pbcertencoded

where icertindex between 0 (end-certificate) , chainsize -1 (self-signed root certificate).


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -