本文介绍了从XEnroll acceptPKCS7(string cert)到CertEnroll InstallResponse?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我正在尝试将一些XEnroll调用转换为CertEnroll调用,而我在acceptPKCS7方面遇到了一些麻烦.尝试手动安装从服务器获取的证书,编码为STRING_BASE64HEADER.

这一切都可以,但是当我尝试使用InstallResponse进行注册时,得到了未经处理的COMException:

CertEnroll :: CX509Enrollment :: p_InstallResponse:找不到对象或属性. 0x80092004(-2146885628)

代码:

CERTENROLLLib.CX509EnrollmentClass enroll = new CERTENROLLLib.CX509EnrollmentClass();

enroll.InitializeFromRequest(req);
注册.创建证书.

我也尝试将XCN_CRYPT_STRING_BASE64HEADER更改为XCN_CRYPT_STRING_BASE64,即使它具有标头,然后得到无效数据".但是,这是唯一导致除找不到对象或属性"之外的任何内容的编码类型. >解决方案


Hi!

I'm trying to convert some XEnroll calls to CertEnroll calls and I'm having some trouble with acceptPKCS7.

I manage to create a request ok, and I have tried manually installing the certificate that I get back from the server, encoded as STRING_BASE64HEADER.

This all works but when I try to enroll using the InstallResponse I get an unhandeled COMException:

CertEnroll::CX509Enrollment:: p_InstallResponse: Cannot find object or property. 0x80092004 (-2146885628)

The code:

CERTENROLLLib.CX509EnrollmentClass enroll = new CERTENROLLLib.CX509EnrollmentClass();

enroll.InitializeFromRequest(req);
enroll.InstallResponse(CERTENROLLLib.InstallResponseRestrictionFlags.AllowNone,sCertificate, CERTENROLLLib.EncodingType.XCN_CRYPT_STRING_BASE64HEADER, null);


Where sCertifcate is the certificate string and req is the CERTENROLLLib.CX509CertificateRequestPkcs10Class that was used to create the certificate.

I also tried changing XCN_CRYPT_STRING_BASE64HEADERto XCN_CRYPT_STRING_BASE64 even though it have headers and then I get "invalid data". However this is the only encoding type that have resulted in anything else then "Cannot find object or property".

Any help what so ever would be very much appreciated.

解决方案


这篇关于从XEnroll acceptPKCS7(string cert)到CertEnroll InstallResponse?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 19:48