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:
- obtain first certificate using
certfindcertificateinstore(done) - get certificate chain using
certgetcertificatechain(done) - extract certificates chain (?)
- for each certificate in chain, convert using
d2i_x509(done)
or
- obtain first certificate using
certfindcertificateinstore(done) - get parent certificate (if exists) (?)
- 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
Post a Comment