C# Generate a non self signed client CX509Certificate Request without a CA using the certenroll.dll

旧巷老猫 提交于 2019-12-01 00:45:09

I was able to solve this.

The encoding of SEScert is a hex string not base64 also the machine context should be set to true not false the correct code looks as follows:

ISignerCertificate signerCertificate = new CSignerCertificate();
signerCertificate.Initialize(true, X509PrivateKeyVerify.VerifyNone,EncodingType.XCN_CRYPT_STRING_HEX, SEScert.GetRawCertDataString());
cert.SignerCertificate = (CSignerCertificate)signerCertificate; 

Hope this helps others in the future.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!