我想使用模板请求证书(来自 AD 证书服务器)。我想在请求中提供公钥。使用 msft 的 SDK 示例
IX509CertificateRequest iRequest = objEnroll.Request;
// then get the inner PKCS10 request
IX509CertificateRequest iInnerRequest =
iRequest.GetInnerRequest(InnerRequestLevel.LevelInnermost);
IX509CertificateRequestPkcs10 iRequestPkcs10 =
iInnerRequest as IX509CertificateRequestPkcs10;
// create CX500DistinguishedName
CX500DistinguishedName objName = new CX500DistinguishedName();
objName.Encode(subjectName, X500NameFlags.XCN_CERT_NAME_STR_NONE);
// set up the subject name
iRequestPkcs10.Subject = objName;
我想我需要做这样的事情
iRequestPkcs10.PublicKey.InitializeFromEncodedPublicKeyInfo(xx);
但我不知道 xx 是什么。我有公钥(在充气城堡 PKCS10 对象中),但它必须采用什么格式才能传递给这个函数?