Ошибка эцп cryptoapi exception cryptacquirecertificateprivatekey failed lastwinerror 0x8009001d
Не выполняется строчка:
let sSignedMessage = yield oSignedData.SignCades(oSigner, CADESCOM_CADES_X_LONG_TYPE_1);
Ошибка неустановленного корневого сертификата, но он установлен аж в 3 директориив личные с "Доверенные корневые центры сертификации" и "Доверенные лица"
A certificate chain could not be built to a trusted root authority. (0x800B010A)
The text was updated successfully, but these errors were encountered:
Parameters
A pointer to a handle of a CSP. When you have finished using the CSP, release the handle by calling the CryptReleaseContext function.
The key container name. This is a null-terminated string that identifies the key container to the CSP. This name is independent of the method used to store the keys. Some CSPs store their key containers internally (in hardware), some use the system registry, and others use the file system. In most cases, when dwFlags is set to CRYPT_VERIFYCONTEXT, pszContainer must be set to NULL. However, for hardware-based CSPs, such as a smart card CSP, can be access publicly available information in the specfied container.
For more information about the usage of the pszContainer parameter, see Remarks.
A null-terminated string that contains the name of the CSP to be used.
If this parameter is NULL, the user default provider is used. For more information, see Cryptographic Service Provider Contexts. For a list of available cryptographic providers, see Cryptographic Provider Names.
An application can obtain the name of the CSP in use by using the CryptGetProvParam function to read the PP_NAME CSP value in the dwParam parameter.
The default CSP can change between operating system releases. To ensure interoperability on different operating system platforms, the CSP should be explicitly set by using this parameter instead of using the default CSP.
Specifies the type of provider to acquire. Defined provider types are discussed in Cryptographic Provider Types.
Flag values. This parameter is usually set to zero, but some applications set one or more of the following flags.
For file-based CSPs, when this flag is set, the pszContainer parameter must be set to NULL. The application has no access to the persisted private keys of public/private key pairs. When this flag is set, temporary public/private key pairs can be created, but they are not persisted.
For hardware-based CSPs, such as a smart card CSP, if the pszContainer parameter is NULL or blank, this flag implies that no access to any keys is required, and that no UI should be presented to the user. This form is used to connect to the CSP to query its capabilities but not to actually use its keys. If the pszContainer parameter is not NULL and not blank, then this flag implies that access to only the publicly available information within the specified container is required. The CSP should not ask for a PIN. Attempts to access private information (for example, the CryptSignHash function) will fail.
When CryptAcquireContext is called, many CSPs require input from the owning user before granting access to the private keys in the key container. For example, the private keys can be encrypted, requiring a password from the user before they can be used. However, if the CRYPT_VERIFYCONTEXT flag is specified, access to the private keys is not required and the user interface can be bypassed.
Windows XP: A key container created without this flag by an administrator can be accessed only by the user creating the key container and the local system account.
A key container created without this flag by a user that is not an administrator can be accessed only by the user creating the key container and the local system account.
The CRYPT_MACHINE_KEYSET flag can be combined with all of the other flags to indicate that the key container of interest is a computer key container and the CSP treats it as such. For Base Providers, this means that the keys are stored locally on the computer that created the key container. If a key container is to be a computer container, the CRYPT_MACHINE_KEYSET flag must be used with all calls to CryptAcquireContext that reference the computer container. The key container created with CRYPT_MACHINE_KEYSET by an administrator can be accessed only by its creator and by a user with administrator privileges unless access rights to the container are granted using CryptSetProvParam.
Windows XP: The key container created with CRYPT_MACHINE_KEYSET by an administrator can be accessed only by its creator and by the local system account unless access rights to the container are granted using CryptSetProvParam.
The key container created with CRYPT_MACHINE_KEYSET by a user that is not an administrator can be accessed only by its creator and by the local system account unless access rights to the container are granted using CryptSetProvParam.
The CRYPT_MACHINE_KEYSET flag is useful when the user is accessing from a service or user account that did not log on interactively. When key containers are created, most CSPs do not automatically create any public/private key pairs. These keys must be created as a separate step with the CryptGenKey function.
When this flag is set, the value returned in phProv is undefined, and thus, the CryptReleaseContext function need not be called afterward.
CRYPT_SILENT is intended for use with applications for which the UI cannot be displayed by the CSP.
Windows Server 2003 and Windows XP: This flag is not supported.
pavenkostanislav commented Sep 7, 2017 •
sign.zip
Вот так лучше всего. не все форматы можно добавлять
splincode commented Sep 7, 2017
подпись не проходит проверку.
Хеш указанного файла:
CB AE CB 61 1C 3B F9 6A 8E B1 63 B3 CE E7 EA D5 05 1F A4 C1 9B EF 15 FB 98 64 1F 3D 0C BB 84 C3
а в p7s прохешировано было что-то "другое":
64 D5 52 BF 80 B9 0E B1 C9 3D 29 83 5D 54 D5 57 0C F4 B0 45 9B 92 D9 79 D9 43 13 05 81 BB 2B FF
- ASN.1 анализатор выдал 1 предупреждение и 1 ошибку.
позиция:
3300 0: [0] Error: Object has zero length.
3302 15: GeneralizedTime 07/09/2017 07:21:15 GMT
Warning: Further data follows ASN.1 data at position 10798.
Syntax
Дополнительная информация
pavenkostanislav commented Sep 7, 2017 •
Пока нет ответа
но с начала переписки в приципе какая-то подпись создалась и ошибки нет больше.
Вот только эта подпись не проходит проверку в Контуре.Крипто и даже в КриптоПро DSS
pavenkostanislav commented Sep 7, 2017 •
Ну для начала спасибо.
Но мне бы больше информации.
Я тем же путём создавал прикреплённую подпись - всё проходит проверку
Ещё ошибку пофиксил:
oSignedData.Content = dataToSign.replace('data:application/pdf;base64,', '');
splincode commented Sep 7, 2017
Приложите документ и подпись
Сводка
Вызовы к CryptAcquireContext функции могут включать различные флаги. Важно знать, когда использовать эти флаги. В этой статье данная статья содержит сведения о том, когда использовать конкретные флаги при вызове и о причинах CryptAcquireContext использования этих флагов.
Выполняются операции с закрытыми ключами
Если вы планируете выполнять операции с закрытыми ключами, необходимо учитывать множество проблем.
Лучший способ получения контекста — попытаться открыть контейнер. Если эта попытка не удается NTE_BAD_KEYSET", создайте контейнер с помощью CRYPT_NEWKEYSET флага.
Приложения не должны использовать контейнер ключа по умолчанию, передав NULL имя контейнера для хранения закрытых ключей. Если несколько приложений используют один и тот же контейнер, одно приложение может изменить или уничтожить ключи, которые должны быть доступны другому приложению. Если в приложениях используются контейнеры ключей с уникальным именем, снижается риск, связанный с другими приложениями, которые могут подделыть ключи, необходимые для правильной работы.
pavenkostanislav commented Sep 7, 2017 •
Если код подписания выглядит так:
Ключевое отличие тут:
//let byteCharacters: string;
//if (this.crypto.isChromium) // byteCharacters = window.atob(b64Data);
//> else // byteCharacters = Base64.decode(b64Data);
//>
Remarks
When CRYPT_ACQUIRE_WINDOW_HANDLE_FLAG is set, the caller must ensure the HWND is valid. If the HWND is no longer valid, for CSP the caller should call CryptSetProvParam using flag PP_CLIENT_HWND with NULL for the HWND and NULL for the HCRYPTPROV. For KSP, the caller should set the NCRYPT_WINDOW_HANDLE_PROPERTY of the ncrypt key to be NULL. When CRYPT_ACQUIRE_WINDOW_HANDLE_FLAG flag is set for KSP, the NCRYPT_WINDOW_HANDLE_PROPERTY is set on the storage provider and the key. If both calls fail, then the function fails. If only one fails, the function succeeds. Note that setting HWND to NULL effectively removes HWND from the HCRYPTPROV or ncrypt key.
В этой статье приводится информация об использовании определенных флагов при вызове CryptAcquireContext и причинах использования этих флагов.
Применяется к: Windows Server 2012 R2
Исходный номер КБ: 238187
splincode commented Sep 7, 2017
splincode commented Sep 7, 2017
В принципе, ответы оставляют на форуме сотрудники КриптоПро, если что пишите сюда решение
Использование флага CRYPT_MACHINE_KEYSET
Если вы не выполняете операции частных ключей на основе каждого пользователя и вам необходимы глобальные операции личных ключей, CRYPT_MACHINE_KEYSET следует использовать. Этот метод создает пару закрытых и общедоступных ключей на компьютерной основе. Некоторые конкретные сценарии, в CRYPT_MACHINE_KEYSET которых следует использовать:
- Вы пишете службу.
- Компонент работает на странице ASP (ASP).
- Ваш компонент — это компонент Microsoft Transaction Server (MTS). В этих примерах CRYPT_MACHINE_KEYSET, так как контекст безопасности, в котором работает приложение, не имеет доступа к профиле пользователя. Например, клиент МТС может выдать себя за пользователя, но его профиль не доступен, так как пользователь не вошел в систему. То же самое относится и к компоненту, который работает на странице ASP.
pavenkostanislav commented Sep 6, 2017
pavenkostanislav commented Sep 6, 2017
Предоставление доступа к контейнеру
По умолчанию, когда создается контейнер ключей, локализованная система и создатель являются единственными пользователями, которые имеют доступ к контейнеру. Исключением является создание администратором контейнера ключей. Локализованная система и все другие администраторы будут иметь доступ к контейнеру ключей. Любой другой контекст безопасности не может открыть контейнер.
Если код будет работать в более чем одном контексте безопасности, необходимо предоставить соответствующим пользователям доступ к контейнеру.
Чтобы установить безопасность на контейнере, позвоните в функцию CryptSetProvParam с флагом PP_KEYSET_SEC_DESCR после создания контейнера. Этот метод позволяет установить дескриптор безопасности на контейнере.
В следующем коде показано, как вызывать CryptSetProvParam. Это делается сразу после создания контейнера ключей.
Return value
If the function succeeds, the function returns nonzero (TRUE).
If the function fails, it returns zero (FALSE). For extended error information, call GetLastError.
The error codes prefaced by NTE are generated by the particular CSP being used. Some possible error codes defined in Winerror.h follow.
Return code/value | Description |
---|---|
ERROR_BUSY 107L | Some CSPs set this error if the CRYPT_DELETEKEYSET flag value is set and another thread or process is using this key container. |
ERROR_FILE_NOT_FOUND 2L | The profile of the user is not loaded and cannot be found. This happens when the application impersonates a user, for example, the IUSR_ComputerName account. |
ERROR_INVALID_PARAMETER 87L | One of the parameters contains a value that is not valid. This is most often a pointer that is not valid. |
ERROR_NOT_ENOUGH_MEMORY 8L | The operating system ran out of memory during the operation. |
NTE_BAD_FLAGS 0x80090009L | The dwFlags parameter has a value that is not valid. |
NTE_BAD_KEY_STATE 0x8009000BL | The user password has changed since the private keys were encrypted. |
NTE_BAD_KEYSET 0x80090016L | The key container could not be opened. A common cause of this error is that the key container does not exist. To create a key container, call CryptAcquireContext using the CRYPT_NEWKEYSET flag. This error code can also indicate that access to an existing key container is denied. Access rights to the container can be granted by the key set creator by using CryptSetProvParam. |
NTE_BAD_KEYSET_PARAM 0x8009001FL | The pszContainer or pszProvider parameter is set to a value that is not valid. |
NTE_BAD_PROV_TYPE 0x80090014L | The value of the dwProvType parameter is out of range. All provider types must be from 1 through 999, inclusive. |
NTE_BAD_SIGNATURE 0x80090006L | The provider DLL signature could not be verified. Either the DLL or the digital signature has been tampered with. |
NTE_EXISTS 0x8009000FL | The dwFlags parameter is CRYPT_NEWKEYSET, but the key container already exists. |
NTE_KEYSET_ENTRY_BAD 0x8009001AL | The pszContainer key container was found but is corrupt. |
NTE_KEYSET_NOT_DEF 0x80090019L | The requested provider does not exist. |
NTE_NO_MEMORY 0x8009000EL | The CSP ran out of memory during the operation. |
NTE_PROV_DLL_NOT_FOUND 0x8009001EL | The provider DLL file does not exist or is not on the current path. |
NTE_PROV_TYPE_ENTRY_BAD 0x80090018L | The provider type specified by dwProvType is corrupt. This error can relate to either the user default CSP list or the computer default CSP list. |
NTE_PROV_TYPE_NO_MATCH 0x8009001BL | The provider type specified by dwProvType does not match the provider type found. Note that this error can only occur when pszProvider specifies an actual CSP name. |
NTE_PROV_TYPE_NOT_DEF 0x80090017L | No entry exists for the provider type specified by dwProvType. |
NTE_PROVIDER_DLL_FAIL 0x8009001DL | The provider DLL file could not be loaded or failed to initialize. |
NTE_SIGNATURE_FILE_BAD 0x8009001CL | An error occurred while loading the DLL file image, prior to verifying its signature. |
splincode commented Sep 7, 2017
Это рабочая версия? Надо будет добавить код в основной репозиторий, когда появится новая версия, я обязательно вам пришли, чтобы вы сделали pull request
Ошибки CryptAcquireContext
Ниже приводится наиболее распространенный код ошибки и возможные причины ошибки.
Important This API is deprecated. New and existing software should start using Cryptography Next Generation APIs. Microsoft may remove this API in future releases.
The CryptAcquireContext function is used to acquire a handle to a particular key container within a particular cryptographic service provider (CSP). This returned handle is used in calls to CryptoAPI functions that use the selected CSP.
This function first attempts to find a CSP with the characteristics described in the dwProvType and pszProvider parameters. If the CSP is found, the function attempts to find a key container within the CSP that matches the name specified by the pszContainer parameter. To acquire the context and the key container of a private key associated with the public key of a certificate, use CryptAcquireCertificatePrivateKey.
With the appropriate setting of dwFlags, this function can also create and destroy key containers and can provide access to a CSP with a temporary key container if access to a private key is not required.
pavenkostanislav commented Sep 7, 2017
Да спасибо. С тестовой службой подпись создалась, но теперь проблема в проверке её:
Parameters
The address of a CERT_CONTEXT structure that contains the certificate context for which a private key will be obtained.
A set of flags that modify the behavior of this function. This can be zero or a combination of one or more of the following values.
When this flag is set, the pfCallerFreeProvOrNCryptKey parameter receives FALSE and the calling application must not release the handle. The handle is freed when the certificate context is freed; however, you must retain the certificate context referenced by the pCert parameter as long as the key is in use, otherwise operations that rely on the key will fail.
This function will only use caching if during a previous call, the dwFlags member of the CRYPT_KEY_PROV_INFO structure contained CERT_SET_KEY_CONTEXT_PROP.
Do not use this flag with CRYPT_ACQUIRE_SILENT_FLAG.
The following flags determine which technology is used to obtain the key. If none of these flags is present, this function will only attempt to obtain the key by using CryptoAPI.
Windows Server 2003 and Windows XP: These flags are not supported.
The pdwKeySpec variable receives the CERT_NCRYPT_KEY_SPEC flag if CNG is used to obtain the key.
The pdwKeySpec variable receives the CERT_NCRYPT_KEY_SPEC flag if CNG is used to obtain the key.
The pdwKeySpec variable receives the CERT_NCRYPT_KEY_SPEC flag if CNG is used to obtain the key.
Note CryptoAPI does not support the CNG Diffie-Hellman or DSA asymmetric algorithms. CryptoAPI only supports Diffie-Hellman and DSA public keys through the legacy CSPs. If this flag is set for a certificate that contains a Diffie-Hellman or DSA public key, this function will implicitly change this flag to CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG to first attempt to use CryptoAPI to obtain the key.
[in, optional] pvParameters
If the CRYPT_ACQUIRE_WINDOW_HANDLE_FLAG is set, then this is the address of an HWND. If the CRYPT_ACQUIRE_WINDOW_HANDLE_FLAG is not set, then this parameter must be NULL.
Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This parameter was named pvReserved and reserved for future use and must be NULL.
The address of an HCRYPTPROV_OR_NCRYPT_KEY_HANDLE variable that receives the handle of either the CryptoAPI provider or the CNG key. If the pdwKeySpec variable receives the CERT_NCRYPT_KEY_SPEC flag, this is a CNG key handle of type NCRYPT_KEY_HANDLE; otherwise, this is a CryptoAPI provider handle of type HCRYPTPROV.
For more information about when and how to release this handle, see the description of the pfCallerFreeProvOrNCryptKey parameter.
The address of a DWORD variable that receives additional information about the key. This can be one of the following values.
Windows Server 2003 and Windows XP: This value is not supported.
The address of a BOOL variable that receives a value that indicates whether the caller must free the handle returned in the phCryptProvOrNCryptKey variable. This receives FALSE if any of the following is true:
- Public key acquisition or comparison fails.
- The dwFlags parameter contains the CRYPT_ACQUIRE_CACHE_FLAG flag.
- The dwFlags parameter contains the CRYPT_ACQUIRE_USE_PROV_INFO_FLAG flag, the certificate context property is set to CERT_KEY_PROV_INFO_PROP_ID with the CRYPT_KEY_PROV_INFO structure, and the dwFlags member of the CRYPT_KEY_PROV_INFO structure is set to CERT_SET_KEY_CONTEXT_PROP_ID.
If this variable receives TRUE, the caller is responsible for releasing the handle returned in the phCryptProvOrNCryptKey variable. If the pdwKeySpec variable receives the CERT_NCRYPT_KEY_SPEC value, the handle must be released by passing it to the NCryptFreeObject function; otherwise, the handle is released by passing it to the CryptReleaseContext function.
Remarks
The pszContainer parameter specifies the name of the container that is used to hold the key. Each container can contain one key. If you specify the name of an existing container when creating keys, the new key will overwrite a previous one.
The combination of the CSP name and the key container name uniquely identifies a single key on the system. If one application tries to modify a key container while another application is using it, unpredictable behavior may result.
If you set the pszContainer parameter to NULL, the default key container name is used. When the Microsoft software CSPs are called in this manner, a new container is created each time the CryptAcquireContext function is called. However, different CSPs may behave differently in this regard. In particular, a CSP may have a single default container that is shared by all applications accessing the CSP. Therefore, applications must not use the default key container to store private keys. Instead, either prevent key storage by passing the CRYPT_VERIFYCONTEXT flag in the dwFlags parameter, or use an application-specific container that is unlikely to be used by another application.
An application can obtain the name of the key container in use by using the CryptGetProvParam function to read the PP_CONTAINER value.
For performance reasons, we recommend that you set the pszContainer parameter to NULL and the dwFlags parameter to CRYPT_VERIFYCONTEXT in all situations where you do not require a persisted key. In particular, consider setting the pszContainer parameter to NULL and the dwFlags parameter to CRYPT_VERIFYCONTEXT for the following scenarios:
- You are creating a hash.
- You are generating a symmetric key to encrypt or decrypt data.
- You are deriving a symmetric key from a hash to encrypt or decrypt data.
- You are verifying a signature. It is possible to import a public key from a PUBLICKEYBLOB or from a certificate by using CryptImportKey or CryptImportPublicKeyInfo. A context can be acquired by using the CRYPT_VERIFYCONTEXT flag if you only plan to import the public key.
- You plan to export a symmetric key, but not import it within the crypto context's lifetime. A context can be acquired by using the CRYPT_VERIFYCONTEXT flag if you only plan to import the public key for the last two scenarios.
- You are performing private key operations, but you are not using a persisted private key that is stored in a key container.
Examples
The following example shows acquiring a cryptographic context and access to public/private key pairs in a key container. If the requested key container does not exist, it is created.
For an example that includes the complete context for this example, see Example C Program: Creating a Key Container and Generating Keys. For additional examples, see Example C Program: Using CryptAcquireContext.
The wincrypt.h header defines CryptAcquireContext as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Операции закрытых ключей не выполняются
Если вы не используете закрытый ключ, флаг CRYPT_VERIFYCONTEXT (0xF0000000) можно использовать, когда называется CryptAcquireContext. Это указывает CryptoAPI на создание контейнера ключей в памяти, который будет выпущен при призвании CryptReleaseContext. При этом флаге параметр pszContainer должен быть NULL. Флаг CRYPT_VERIFYCONTEXT можно использовать в следующих сценариях:
Вы создаете hash.
Создается симметричный ключ для шифрования или расшифровки данных.
Вы извлекаем симметричный ключ из hash для шифрования или расшифровки данных.
Вы проверяете подпись. Можно импортировать общедоступный ключ из PUBLICKEYBLOB или из сертификата с помощью CryptImportKey или CryptImportPublicKeyInfo.
Вы планируете экспортировать симметричный ключ, но не импортировать его в течение срока службы крипто-контекста.
Контекст можно приобрести с помощью флага CRYPT_VERIFYCONTEXT, если планируется импортировать общедоступный ключ только для двух последних сценариев.
Вы выполняете операции с закрытыми ключами, но не используете сохраненный закрытый ключ, хранимый в контейнере ключей.
pavenkostanislav commented Sep 7, 2017 •
Ну как рабочая. Сертификат проверку не проходит
вырезка из рабочего проекта тут pavenkostanislav/GetingCertificatesList можно посмотреть, но если честно я его не компилил.
splincode commented Sep 7, 2017
Syntax
Return value
If the function succeeds, the return value is nonzero (TRUE).
If the function fails, the return value is zero (FALSE). For extended error information, call GetLastError. One possible error code is the following.
Return code | Description |
---|---|
NTE_BAD_PUBLIC_KEY | The public key in the certificate does not match the public key returned by the CSP. This error code is returned if the CRYPT_ACQUIRE_COMPARE_KEY_FLAG is set and the public key in the certificate does not match the public key returned by the cryptographic provider. |
NTE_SILENT_CONTEXT | The dwFlags parameter contained the CRYPT_ACQUIRE_SILENT_FLAG flag and the CSP could not continue an operation without displaying a user interface. |
pavenkostanislav commented Sep 8, 2017 •
Доброе время суток, уже близок к усуществению отсоединённой подписи, присоединённая уже получается и проходит проверку на сайте Сервер электронной подписи КриптоПро DSS.
Возможно Вы сможете помочь с решением вопроса: "Отсоединённой подпись не проходит проверку, а присоединённая подпись проходит"
Вот этим кодом я делаю подпись:
Эта статья описывает типичные ошибки работы КриптоПро ЭЦП Browser plug-in в браузерах и предлагает способы их решения.
Появляется окно КриптоПро CSP Вставьте ключевой носитель
Появление данного окна значит, что у Вас не вставлен носитель с закрытым ключом для выбранного Вами сертификата.
Необходимо вставить ключевой носитель. Убедитесть, что устройство отображается в Диспетчере Устройств Windows. Установите драйверы на устройство с сайта производителя если они не установлены.
Если предыдущие действия не помогли, необходимо переустановить сертификат в хранилище Личное текущего пользователя с привязкой к закрытому ключу. См статью.
Не удалось создать подпись из-за ошибки: Не удается построить цепочку сертификатов для доверенного корневого центра. (0x800B010A)
Эта ошибка возникает, когда невозможно проверить статус сертификата (нет доступа к спискам отзыва или OCSP службе), либо не установлены корневые сертификаты.
Проверьте, строится ли цепочка доверия: откройте сертификат (например через Пуск -> Все программы -> КриптоПро -> Сертификаты-Текущий Пользователь -> Личное -> Сертификаты), перейдите на вкладку Путь сертификации. Если на этой вкладке присутствуют красные кресты, или вообще нет ничего кроме текущего сертификата (кроме тех случаев если сертификат является самоподписанным), значит цепочка доверия не построена.
Скриншоты с примерами сертификатов, у которых не строится цепочка доверия.
Если вы используете квалифицированный сертификат, то попробуйте установить в доверенные корневые эти 2 сертификата. Это сертификаты Головного УЦ Минкомсвязи и Минцифры. От них, при наличии интернета, должна построится цепочка доверия у любого квалифицированного сертификата.
Чтобы установить скачанный сертификат в доверенные корневые центры сертификации, нажмите по нему правой кнопкой-Выберите пункт –Установить сертификат- Локальный компьютер (если такой выбор есть) - Поместить все сертификаты в следующие хранилище-Обзор-Доверенные корневые центры сертификации-Ок- Далее- Готово- когда появится предупреждение системы безопасности об установке сертификата- нажмите Да-Ок.
Если этого недостаточно, обратитесь в УЦ, выдавший вам сертификат, за сертификатом самого УЦ.
Полученный от УЦ сертификат является промежуточным в цепочке Минкомсвязи -> УЦ -> вы, поэтому при его установке выбирайте хранилище "Промежуточные центры сертификации".
Важно: Если вы создаете CAdES-T (доверенное время) или CAdES-XLongType 1 (доверенное время и доказательства подлинности), ошибка цепочки может возникать если нет доверия к сертификату оператора TSP службы. В этом случае необходимо установить в доверенные корневые центры сертификации корневой сертификат УЦ, предоставляющего службу TSP.
При создании подписи появляется окно с ошибкой "Не удается найти сертификат и закрытый ключ для расшифровки. (0x8009200B)", в информации о сесртификате отображается "нет привязки к закрытому ключу"
Подпись создается, но также отображается статус "ошибка при проверке цепочки сертификатов".
Это значит, что нет доступа к спискам отозванных сертификатов.
Списки отозванных сертификатов можно скачать на сайте УЦ, выдавшем сертификат, после получения списка его необходимо установить, процедура идентична процедуре установки промежуточного сертификата ЦС. При отсутствии ограничений на доступ в сеть Интернет списки обновляются автоматически.
Ошибка: 0x8007064A/0x8007065B
Причина ошибки - истёк срок действия лицензий на КриптоПро CSP и/или КриптоПро TSP Client 2.0 и/или Криптопро OCSP Client 2.0.
Для создания CAdES-BES подписи должна быть действующая лицензия на КриптоПро CSP.
Для создания CAdES-T должны быть действующими лицензии на: КриптоПро CSP, КриптоПро TSP Client 2.0.
Для создания XLT1 должны быть действующими лицензии на: КриптоПро CSP, КриптоПро TSP Client 2.0, КриптоПро OCSP Client 2.0
Посмотреть статус лицензий можно через: Пуск- Все программы- КРИПТО-ПРО- Управление лицензиями КриптоПро PKI.
Чтобы активировать имеющуюся лицензию:
- откройте Пуск -> Все программы -> КРИПТО-ПРО -> Управление лицензиями КриптоПро PKI
- выберите нужный программный продукт -> откройте контекстное меню (щелкнуть правой кнопкой мыши) -> выберите пункт "Все задачи" -> выберите пункт "Ввести серийный номер. "
- введите в поле информацию о лицензии и нажмите OK чтобы сохранить её.
Отказано в доступе (0x80090010)
Ошибка: Invalid algorithm specified. (0x80090008)
Ошибка возникает, если Вы используете сертификат, алгоритм которого не поддерживается Вашим криптопровайдером.
Пример: У вас установлен КриптоПро CSP 3.9 а сертификат Выпущен по ГОСТ 2012.
Или если используется алгоритм хеширования, не соответствующий сертификату.
The CryptAcquireCertificatePrivateKey function obtains the private key for a certificate. This function is used to obtain access to a user's private key when the user's certificate is available, but the handle of the user's key container is not available. This function can only be used by the owner of a private key and not by any other user.
If a CSP handle and the key container containing a user's private key are available, the CryptGetUserKey function should be used instead.
Читайте также: