Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7400011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:08:16+00:00 2026-05-29T04:08:16+00:00

I would like to copy all encryption certificates associated with one marker-file onto a

  • 0

I would like to copy all encryption certificates associated with one marker-file onto a set of other files.

Sure, there’s the QueryUsersOnEncryptedFile function that returns a PENCRYPTION_CERTIFICATE_HASH_LIST, and there’s the AddUsersToEncryptedFile function, that takes a PENCRYPTION_CERTIFICATE_LIST.

So, as far as I understand, to copy the certificates over, these hashes need to be converted back into a list of certificates.

To make this transition, I’ve been messing around with CertFindCertificateInStore. That worked up to some extend, but not for all certificates, I don’t even know which certificates store(s) I should query… I did tried a few : CA, ROOT, MY, SPC, Trust, TrustedPeople, AuthRoot (and even AddressBook, which seems to contain an out-dated cache of certificates, as some where already expired) but none of them gave me access to all certificates that I have hashes for.

So, how can I reliably map a certificate hash back to the certificate itself?
(Some example code would be nice.)

Thanks in advance!


As a side-note:

I would also like to remove all other certificates from these same target files. For this purpose, there’s a function available, called RemoveUsersFromEncryptedFile, which also takes a PENCRYPTION_CERTIFICATE_HASH_LIST.

I imagine this list could be gathered by first calling QueryUsersOnEncryptedFile on each file, and pass the resulting certificate hash list to RemoveUsersFromEncryptedFile (on the same file).

But there’s a caveat: I don’t want to loose all certificates, or the files won’t be accessible to anyone anymore! Can I safely zero-out my own (and by extension any other allowed) certificate hash from this intermediate hash list? (Given that there’s also a dedicated FreeEncryptionCertificateHashList function.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:08:17+00:00Added an answer on May 29, 2026 at 4:08 am

    I found the answer myself : There’s an API called DuplicateEncryptionInfoFile which does exactly what I need. I should have searched a bit further…

    Thanks for reading though, I hope this question + answer will help someone, someday 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to batch copy and rename all files from a directory, recursively.
I would like to copy one database (almost all tables) to another server. So
I would like to ask if it is possible to copy/move all the objects
I would like copy just file.xml without folder structure using overlays like this: <overlays>
I would like to copy a macro from one Excel workbook to another using
I would like to copy one object to another object, and the fields with
I would like to make a simple windows installer to copy some files into
I would like to optimize my scp deployment which currently copies all files to
(see jsfiddle example) When the .link_to_rule_them_all is clicked i would like to copy all
Alright I have a gigantic list of files I would like to copy from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.