You just need to get a COM/ActiveX version of a PDF library that supports the PDF features you want.
I'm not aware of any free option that is a COM/ActiveX, has the features you want, and works well. Amyuni is the most popular option among Appeon customers: https://www.amyuni.com/en/developer-tools/pdf-creator-developer-pro/for-activex
Your question piqued my interest, enough to look into what Windows API functions, if any, are provided by Microsoft in this area. Digital Certificates reside in the realm of cryptography, due to their reliance on private/public cryptographic keys. So you can get an idea, here's a link to an overview of Digital Certificates in the online Microsoft Documentation for Windows:
https://docs.microsoft.com/en-us/windows/win32/seccrypto/digital-certificates
A little topic browsing should reinforce what a potentially complex and involved task it would be to attempt to utilize low-level Windows API functions to create and assign Digital Certificates. I found several C++ code examples for relatively simple tasks. The topic appears to be formidable unless you are skilled in C++, the Crypto API and/or .NET libraries.
I agree with Armeen that a vendor-supplied COM/ActiveX solution is likely to be your best bet.