Создаю усовершенствованную подпись с тестовым сервером времени -
http://cryptopro.ru/tsp/:_sign = function (thumbprint, dataToSign) {
var store = _getStore(),
storeLocation = _detectStoreLocation(store),
signedData,
certificates,
certificate,
signer,
signedMessage = null;
if (store !== null && storeLocation !== null) {
store.Open(storeLocation, CAPICOM_MY_STORE, CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED);
certificates = store.Certificates.Find(CAPICOM_CERTIFICATE_FIND_SHA1_HASH, thumbprint);
if (certificates.Count === 0) {
return null;
}
certificate = certificates.Item(1);
signer = _objCreate('CAdESCOM.CPSigner');
signer.Certificate = certificate;
signer.TSAAddress = "http://cryptopro.ru/tsp/";
signedData = _objCreate('CAdESCOM.CadesSignedData');
// Значение свойства ContentEncoding должно быть задано до заполнения свойства Content
signedData.ContentEncoding = CADESCOM_BASE64_TO_BINARY;
signedData.Content = dataToSign;
try {
signedMessage = signedData.SignCades(signer, CADESCOM_CADES_X_LONG_TYPE_1);
} catch (err) {
console.log("Failed to create signature. Error: " + _GetErrorMessage(err));
}
store.Close();
return signedMessage;
}
return null;
}
Получаю ошибку:
Failed to create signature. Error: The revocation process could not continue - the certificate(s) could not be checked. (0x800B010E)
Сделала все как написано тут -
http://www.cryptopro.ru/...sts&t=4577#post25846В логе:
00001813 188.42036438 [5112] cades.dll: {3732} /COcspCheck::COcspTimeSyncHandler::OnResponse/ RevocationCheck.h(569) : Response from OCSP server recieved
00001814 188.42291260 [5112] cades.dll: {3732} /COcspCheck::COcspTimeSyncHandler::OnResponse/ RevocationCheck.h(605) : stampTime >= response.get_SRThisUpdate(index)
00001815 188.42295837 [5112] cades.dll: {3732} /COcspCheck::COcspTimeSyncHandler::OnResponse/ RevocationCheck.h(610) : (413) > 60 sec : TSP and OCSP time is out of sync
00001816 188.42333984 [5112] cades.dll: {3732} /COcspCheck::retrieveOcspResponse/ RevocationCheck.h(733) : #success#
00001817 188.42340088 [5112] 12:45:33.682 ::WinHttpCloseHandle(0x7426c0)
00001818 188.42341614 [5112] 12:45:33.682 ::winhttp-dll is shutting down
00001819 188.42346191 [5112] 12:45:33.682 ::Indicate Status 0x7426c0, 0x0, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING (2048), 0x1ed188 [0x7426c0], 4
00001820 188.42347717 [5112] 12:45:33.682 ::WinHttpCloseHandle() returning TRUE
00001821 188.42350769 [5112] cades.dll: {3732} /COcspCheck::checkRevocation/ RevocationCheck.h(385) : #failure# HRESULT: (0x800b010e)
00001822 188.42353821 [5112] cades.dll: {3732} /COcspCheck::checkRevocation/ RevocationCheck.h(385) : Cannot find OCSP response for certificate.
00001823 188.42358398 [5112] cades.dll: {3732} /CadesMsgEnhanceSignatureImpl/ cades.cpp(1137) : Exception thrown: _hr
00001824 188.42367554 [5112] cades.dll: {3732} /CadesMsgEnhanceSignature/ cades.cpp(1172) : COleException, m_sc=0x800b010e
00001825 188.42369080 [5112] cades.dll: {3732} /CadesMsgEnhanceSignature/ cades.cpp(1184) : (res=0, GetLastError=0x800b010e
00001826 188.42372131 [5112] cades.dll: {3732} /CadesSignMessageImpl/ cades.cpp(2143) : Expression FAILED: ::CadesMsgEnhanceSignature(msgDecode.GetHandle(), 0, &cadesSignPara)
00001827 188.42373657 [5112] cades.dll: {3732} /CadesSignMessageImpl/ cades.cpp(2143) : Last win32 error thrown as exception
00001828 188.42381287 [5112] cades.dll: {3732} /CadesSignMessage/ cades.cpp(2190) : COleException, m_sc=0x800b010e
00001829 188.42384338 [5112] cades.dll: {3732} /CadesSignMessage/ cades.cpp(2202) : (res=0, GetLastError=0x800b010e