Astra Linux, cryptcp 5
Пишем программу на C# dotnet core NET6.
Сертификаты ФНС не проходят проверку цепочки сертификатов
var chain = new X509Chain
{
ChainPolicy =
{
RevocationMode = X509RevocationMode.Online,
RevocationFlag = X509RevocationFlag.EntireChain,
UrlRetrievalTimeout = TimeSpan.FromSeconds(10),
VerificationTime = DateTime.Now
}
};
var c = new X509Certificate2(@"n.cer");
c.Verify(); // => false
chain.Build(c); // => false
// => PartialChain: unable to get local issuer certificate
openssl verify n.crt выдает:
error 20 at 0 depth lookup: unable to get local issuer certificate
error 2021.crt: verification failed
124845895636160:error:0609E09C:digital envelope routines:pkey_set_type:unsupported algorithm:../crypto/evp/p_lib.c:210:
124845895636160:error:0B09406F:x509 certificate routines:x509_pubkey_decode:unsupported algorithm:../crypto/x509/x_pubkey.c:114:
124845895636160:error:0609E09C:digital envelope routines:pkey_set_type:unsupported algorithm:../crypto/evp/p_lib.c:210:
124845895636160:error:0B09406F:x509 certificate routines:x509_pubkey_decode:unsupported algorithm:../crypto/x509/x_pubkey.c:114:
124845895636160:error:0609E09C:digital envelope routines:pkey_set_type:unsupported algorithm:../crypto/evp/p_lib.c:210:
124845895636160:error:0B09406F:x509 certificate routines:x509_pubkey_decode:unsupported algorithm:../crypto/x509/x_pubkey.c:114:
124845895636160:error:0B06E06C:x509 certificate routines:X509_get_pubkey_parameters:unable to get certs public key:../crypto/x509/x509_vfy.c:1960:
В Windows проверка на C# chain.Build(c); // => true проходит без ошибок.
Корневой и ЦС сертификаты установил. т.е. всего 3 сертификата в цепочке.
CP_PRINT_CHAIN_DETAIL=1 /opt/cprocsp/bin/amd64/cryptcp -copycert так же проходит проверку.
Есть ли альтернативные способы выполнить проверку из кода?
Отредактировано пользователем 1 февраля 2024 г. 10:51:39(UTC)
| Причина: стало чуть яснее.