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

前端 未结 1 1756
面向向阳花
面向向阳花 2021-01-06 17:50

I have a self signed root certificate that I generated in C# using CERTENROLL.dll\'s CX509CertificateRequest Certificate functionality.

I would like to write a fun

相关标签:
1条回答
  • 2021-01-06 18:32

    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.

    0 讨论(0)
提交回复
热议问题