windowspowershellwinapix509pki

How to programmatically register an Extended Validation OID on Windows?


I need a way of registering an extended validation OID programmatically - Win32 API, Powershell script, etc, it's not hugely important. It just needs to be automated. But I can't find any way of doing this except manually through certmgr.msc: Certmgr


Solution

  • You can use CertSetCertificateContextProperty CryptoAPI function for this and use CERT_ROOT_PROGRAM_CERT_POLICIES_PROP_ID in dwPropId parameter.