We have a valid PKCS#10 Certificate Request generated on the Client using CertEnroll.
Now we need to sign it and return the result to the Client, where CertEnroll will handle the local Certificate Store stuff.
This is a B2B application and the root signing certificate will be self-generated or we can use our existing Thawte SSL cert.
The Server (2008) does not have Active Directory running and we don't want to create a stand-alone signing infrastructure/service for this unless absolutely necessary. There is no need for revocation etc. - we want to do it programmatically.
I would be happy to use the BouncyCastle Library however the C# lib lacks any meaningful documentation and while the original Java docs are admittedly similar the C# implementation is different enough to have left me more than a little confused.
Is anyone aware of (or have) sample C# (or VB) code or a known-relaible link to same, using BouncyCastle or for that matter the native .Net classes ?
Any assistance in getting this thing done would be greatly appreciated!
This proved an interesting exercise to say the least :-)
We used both BouncyCastle and the .Net certificate objects. The solution still has !much! room for improvement, but it does in fact work.
The guts of it (Cert Gen) are below. When we get here the CSR has already been generated on the client and and when we leave the resulting certificate is installed by Client-side code (see this blog for client-side workings.)
Again, I am not offering this as a Finished Product but hopefully of some value to those facing the same task. Happy Encrypting :-)