Нашёл ошибку в передаче параметров, теперь выдает ошибку 2146762486
Не удается построить цепочку сертификатов для доверенного корневого центра.
Вот такой лог:
00000005 8.22616482 [3208] cades.dll: {1980} /CadesSignMessage/ cades.cpp(3581) : (pSignPara=0x0012F590, fDetachedSignature=0, cToBeSigned=1, rgpbToBeSigned=0x01062614, rgcbToBeSigned=0x01062620, ppSignedBlob=0x0106262C)
00000006 10.75151157 [3208] cades.dll: {1980} /CadesSignMessageImpl/ cades.cpp(3400) : Certificate choosed from list
00000007 10.79415321 [3208] cpcspi: Thread: file:line function text xcode(dcode) level: 1
00000008 10.84285450 [3208] cades.dll: {440} /DllMain/ cades.cpp(5385) : hInstance=6E000000, dwReason=2 lpReserved=0
00000009 10.88149452 [3208] cades.dll: {1980} /CadesSignMessageImpl/ cades.cpp(3429) : Signer updating start
00000010 10.88190365 [3208] cades.dll: {1980} /CadesSignMessageImpl/ cades.cpp(3432) : Hash algorithm deduced
00000011 10.88220692 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImplNamespace::AttributeExists/ cades.cpp(167) : (pAttr=0)
00000012 10.88246822 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImplNamespace::UpdateSignedAttributes/ cades.cpp(338) : Signer does not have signinCert or otherSigningCert attribute
00000013 10.88283634 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImplNamespace::UpdateSignedAttributes/ cades.cpp(341) : Attributes copied
00000014 10.93906307 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImplNamespace::UpdateSignedAttributes/ cades.cpp(344) : otherSigningCert attribute assembled
00000015 10.93944550 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImplNamespace::UpdateSignedAttributes/ cades.cpp(347) : Signer is updated successfully
00000016 10.93973827 [3208] cades.dll: {1980} /CadesMsgOpenToEncode/ cades.cpp(448) : (dwMsgEncodingType=0x00010001, dwFlags=0x00000000, pvMsgEncodeInfo=0x0012EFA8, pszInnerContentObjID=0, pStreamInfo=0x00000000)
00000017 10.94014931 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImpl/ cades.cpp(399) : Start
00000018 10.94040489 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImpl/ cades.cpp(404) : Input parameters checked
00000019 10.94065094 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImpl/ cades.cpp(412) : Copy of input structures is ready
00000020 10.94089031 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImpl/ cades.cpp(418) : Signers updating start
00000021 10.94114017 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImpl/ cades.cpp(422) : Signer #0
00000022 10.99933624 [3208] cpext: Thread: file:line function text xcode(dcode) level: 0
00000023 10.99967575 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImplNamespace::CheckAlgorithms/ cades.cpp(366) : Public key info is exported successfully
00000024 11.00104713 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImplNamespace::CheckAlgorithms/ cades.cpp(374) : Signature algoritm OID info is found: 1.2.643.2.2.3
00000025 11.00147533 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImpl/ cades.cpp(429) : Certificates equality checked
00000026 11.00174904 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImplNamespace::DeduceHashAlgorithm/ cades.cpp(147) : (szHashAlgorithm=1.2.643.2.2.9)
00000027 11.00199986 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImpl/ cades.cpp(431) : Hash algorithm deduced
00000028 11.00224400 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImplNamespace::AttributeExists/ cades.cpp(162) : (pAttr->pszObjId=1.2.840.113549.1.9.16.2.19)
00000029 11.00267220 [3208] cades.dll: {1980} /CadesMsgOpenToEncodeImpl/ cades.cpp(436) : Calling CryptMsgOpenToEncode()
00000030 11.00541115 [3208] cades.dll: {1980} /CadesMsgOpenToEncode/ cades.cpp(470) : (hMsg=0x001780B0, GetLastError=0x00000000
00000031 11.00572205 [3208] cades.dll: {1980} /CadesMsgEnhanceSignature/ cades.cpp(1693) : (hCryptMsg=0x001780B0, dwSignatureIndex=0, pCadesSignPara=0x0012F574)
00000032 11.00612926 [3208] cades.dll: {1980} /CadesMsgEnhanceSignatureImpl/ cades.cpp(1592) : Input parameters checked
00000033 11.01034260 [3208] cades.dll: {1980} /CadesMsgEnhanceSignatureImplNamespace::ExtractSignedAttributes/ cades.cpp(491) : Signed attributes extracted via CMSG_SIGNER_AUTH_ATTR_PARAM
00000034 11.01173878 [3208] cades.dll: {1980} /CadesMsgEnhanceSignatureImpl/ cades.cpp(1596) : Signer certificate ID found
00000035 11.01540089 [3208] cades.dll: {3416} /DllMain/ cades.cpp(5385) : hInstance=6E000000, dwReason=2 lpReserved=0
00000036 11.02275944 [3208] cades.dll: {1980} /CadesMsgEnhanceSignatureImpl/ cades.cpp(1605) : pSignerCert=0x00193638
00000037 11.02753830 [3208] cades.dll: {1980} /CadesMsgEnhanceSignatureImpl/ cades.cpp(1626) : Signature verified
00000038 11.02783108 [3208] cades.dll: {1980} /CadesMsgEnhanceSignatureImpl/ cades.cpp(1630) : Hash algorithm deduced
00000039 11.02830029 [3208] cades.dll: {1980} /CadesMsgEnhanceSignatureImplNamespace::ExtractSignature/ cades.cpp(675) : Signature extracted via CMSG_ENCRYPTED_DIGEST
00000040 11.02859974 [3208] cades.dll: {1980} /TlsData/ cades.cpp(60) : Creating new CRequest for the thread...
00000041 11.04262924 [3208] ocspcli.dll: {1980} /CryptoPro::PKI::OCSP::Client::CRequest::Impl::LoadGroupPolicy/ OCSPRequest_Impl.cpp(145) : Loading GP...
00000042 11.04816628 [3208] ocspcli.dll: {1980} /CryptoPro::PKI::OCSP::Client::CRequest::Impl::LoadGroupPolicy/ OCSPRequest_Impl.cpp(145) : Loading GP...
00000043 11.04859734 [3208] cades.dll: {1980} /TlsData/ cades.cpp(66) : Creating new CRequest for the thread... OK.
00000044 11.17084312 [3208] tspcli.dll: {1980} /CryptoPro::PKI::TSP::Client::CRequest::Impl::CheckPolicies/ TSPRequest_Impl.cpp(199) : Checking policies...
00000045 11.17120743 [3208] tspcli.dll: {1980} /CryptoPro::PKI::TSP::Client::CRequest::Impl::CheckPolicies/ TSPRequest_Impl.cpp(285) : Checking policies... OK.
00000046 11.17148495 [3208] tspcli.dll: {1980} /CryptoPro::PKI::TSP::Client::CRequest::Impl::MakeRequest/ TSPRequest_Impl.cpp(158) : Making request...
00000047 11.17207909 [3208] tspcli.dll: {1980} /CryptoPro::PKI::TSP::Client::CRequest::Impl::MakeRequest/ TSPRequest_Impl.cpp(175) : Initializing request...
00000048 11.24162102 [3208] tspcli.dll: {1980} /CryptoPro::PKI::TSP::Client::CRequest::Impl::MakeRequest/ TSPRequest_Impl.cpp(189) : Encoding request...
00000049 11.24188423 [3208] tspcli.dll: {1980} /CryptoPro::PKI::TSP::Client::CRequest::Impl::MakeRequest/ TSPRequest_Impl.cpp(193) : Making request... OK.
00000050 11.27703667 [3208] cades.dll: {3580} /DllMain/ cades.cpp(5385) : hInstance=6E000000, dwReason=2 lpReserved=0
00000051 11.32722664 [3208] cades.dll: {2084} /DllMain/ cades.cpp(5385) : hInstance=6E000000, dwReason=2 lpReserved=0
00000052 11.32800484 [3208] cades.dll: {2912} /DllMain/ cades.cpp(5385) : hInstance=6E000000, dwReason=2 lpReserved=0
00000053 11.38349724 [3208] cades.dll: {1980} /CadesMsgEnhanceSignatureImpl/ cades.cpp(1671) : signatureTimeStampToken recieved and added to signature
00000054 11.38491535 [3208] cades.dll: {2120} /DllMain/ cades.cpp(5385) : hInstance=6E000000, dwReason=2 lpReserved=0
00000055 11.39461040 [3208] cades.dll: {1980} /CadesMsgEnhanceSignatureImplNamespace::MakeCAdES_X_Long/ cades.cpp(1320) : Assert FAILED: CadesVerifyCertificateImpl( signer.GetHandle(), &validationData, false, hMsg, hStore, pProxyPara, 0, false, false, false, &stampTime, 0, SignaturePolicy::ocspcheck, dwStatus)
00000056 11.39531326 [3208] cades.dll: {1980} /CadesMsgEnhanceSignature/ cades.cpp(1703) : CAtlException, m_hr=0x800b010a
00000057 11.39653683 [3208] cades.dll: {1980} /CadesMsgEnhanceSignature/ cades.cpp(1713) : (res=0, GetLastError=0x800b010a
00000058 11.39690971 [3208] cades.dll: {1980} /CadesSignMessageImpl/ cades.cpp(3545) : Last win32 error thrown as exception
00000059 11.39774895 [3208] cades.dll: {1980} /CadesSignMessage/ cades.cpp(3594) : CAtlException, m_hr=0x800b010a
00000060 11.39802742 [3208] cades.dll: {1980} /CadesSignMessage/ cades.cpp(3604) : (res=0, GetLastError=0x800b010a
Проверял сертификат и штамп времени с помощью tsputil и ocsputil, вроде бы все нормально.
Чего еще не хватает?