Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I'm in the process of creating a bunch of attribute certificates, using custom X509 extensions, that all works; this is just the background

When those certificates are displayed in the MMC Certificate Snapin, the OID's of my attributes aren't registered, so under the Certificate Details tab, my extensions are displayed as OID numbers and binary data - ugly

Anyone now how I go about registering a custom OID parser for the MMC snapin please?
Posted

1 solution

Try to extend functionality of CryptDecodeObject function (http://msdn.microsoft.com/en-us/library/aa379871(v=vs.85).aspx[^]).
For this You have to register custom OID decoding function in registry key
HKLM\Software\Microsoft\Cryptography\OID\EncodingType1\CryptDllDecodeObject\YourOID
 
Share this answer
 
Comments
barneyman 30-Aug-11 20:15pm    
thank you very much - I was stumbling towards there :)

I'll post up what I had to do in full when I've got it working
barneyman 30-Aug-11 21:11pm    
Results:

To have the OID string (1.3.6.1.4.1..) replaced by the 'friendly name' of the extension, make a call to CryptRegisterOIDInfo()
This will add to HKLM\Software\Microsoft\Cryptography\OID\EncodingType 0\CryptDLLFindOIDInfo

Caveat here, making this call in a 32bit app under a 64OS will make the mods to WOW6432node, which the cert snapin (being native 64bit) won't find

To format the extension data within the Certificate Details tab, use the CryptRegisterOIDFunction function, with the CRYPT_OID_FORMAT_OBJECT_FUNC flag

Export the named function from a DLL, using a DEF file, and WINAPI fn modifier - it shares the same signature as CryptFormatObject; it expects wide strings

To test/debug simply call CryptFormatObject on your own OID, crypt.dll will defer to your registered function
cariolihome 31-Aug-11 3:19am    
Thanks for the detailed description :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900