0

let us assume, we have a valid HCERTSTORE handle of opened certificate store. How can we determine - is opened store physical or system?

Restriction 1 - we should use CryptoAPI (C++) only.

Restriction 2 - we've successfully forgotten, what kind of store was used in CertOpenStore() call.

MrCat
  • 107
  • 2
  • The restrictions are arbitrary. I don't see a [practical problem](http://stackoverflow.com/help/on-topic) to solve. Handles can't be passed around between processes, so one cannot "forget" what it was unless deliberately. – ivan_pozdeev Oct 16 '15 at 16:18
  • I'm voting to close this question as off-topic because the problem to solve and, specifically, constraints are artificial. – ivan_pozdeev Oct 16 '15 at 16:23

1 Answers1

0

I don't see a way to solve this with CryptoAPI and, as the constraint 2 is artificial, don't think it was designed to address this problem. Closeable handles can't be passed around between processes, so one cannot "forget" what it was unless deliberately: the knowledge is right there, in the code that got the handle.

By looking through the function list in the left pane at CertOpenStore - MSDN, I see CertGetStoreProperty(), but there's only one predefined property, CERT_STORE_LOCALIZED_NAME_PROP_ID, which isn't reliable.

ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152
  • Thanks. I also hadn't seen a way to solve it, that's why i asked. The question is not about "practice" itself, but it helped me to define interface to wrap native certificate store methods, so it's about practice (clearance) for me. – MrCat Oct 16 '15 at 16:48