Статус: Новичок
Группы: Участники
Зарегистрирован: 12.11.2012(UTC) Сообщений: 5
|
Документ подписывается с помощью объекта CAdESCOM.CPSigner из браузера. В браузере с помощью CAdESCOM.CadesSignedData валидация подписи проходит успешно. Пытаюсь проверить подпись на java используя класс ru.CryptoPro.CAdES.CAdESSignature и получаю ошибку CAdES exception occured: Certificate chain is invalid. Как я понял не проходит проверку 1.2.840.113549.1.9.15, cheker отсутствует. Лог проверки и стек трейс привожу. Как то можно корректно выполнить проверку данной подписи? Код:
12.11.2012 12:44:08 ru.CryptoPro.CAdES.tools.Utility initJCPAlgorithms
INFO: Redefinition of the BouncyCastle GOST algorithms.
12.11.2012 12:44:08 ru.CryptoPro.CAdES.CAdESSigner <init>
INFO: Provider: JCP, signature type: null, auto detect: true
Signature #1 (CAdES_X_Long_Type_1)
12.11.2012 12:44:08 ru.CryptoPro.CAdES.CAdESSignature a
INFO: Begin verification...
12.11.2012 12:44:08 ru.CryptoPro.CAdES.CAdESSigner a
INFO: Begin signature verification...
12.11.2012 12:44:08 ru.CryptoPro.CAdES.CAdESSigner a
INFO: Signature type: null
12.11.2012 12:44:08 ru.CryptoPro.CAdES.CAdESSigner a
INFO: Current signature cryptographic provider: JCP
12.11.2012 12:44:08 ru.CryptoPro.CAdES.tools.a d
INFO: Attribute with OID 1.2.840.113549.1.9.16.2.12 is lost.
12.11.2012 12:44:08 ru.CryptoPro.CAdES.tools.a d
INFO: Attribute with OID 1.2.840.113549.1.9.16.2.19 is lost.
12.11.2012 12:44:08 ru.CryptoPro.CAdES.f.a a
INFO: Extract certificate reference by current standart V2.
12.11.2012 12:44:08 ru.CryptoPro.CAdES.tools.a d
INFO: Attribute with OID 1.2.840.113549.1.9.16.2.12 is lost.
12.11.2012 12:44:08 ru.CryptoPro.CAdES.tools.a d
INFO: Attribute with OID 1.2.840.113549.1.9.16.2.19 is lost.
12.11.2012 12:44:08 ru.CryptoPro.CAdES.f.a a
INFO: Extract certificate reference by current standart V2.
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref getOID
CONFIG: System Preference Node: /ru/CryptoPro/JCP/params.AlgIdSpec_class_default=null
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref getOID
CONFIG: System Preference Node: /ru/CryptoPro/JCP/params.AlgIdSpec_class_defaultDH=null
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref getOID
CONFIG: System Preference Node: /ru/CryptoPro/JCP/params.DegreeParamsSpec_class_default=null
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref getOID
CONFIG: System Preference Node: /ru/CryptoPro/JCP/params.DegreeParamsSpec_class_defaultDH=null
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref getOID
CONFIG: System Preference Node: /ru/CryptoPro/JCP/params.EllipticParamsSpecDH_class_defaultDH=null
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref getOID
CONFIG: System Preference Node: /ru/CryptoPro/JCP/params.EllipticParamsSpec_class_defaultECC=null
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref getOID
CONFIG: System Preference Node: /ru/CryptoPro/JCP/params.DigestParamsSpec_class_default=null
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref getOID
CONFIG: System Preference Node: /ru/CryptoPro/JCP/params.CryptParamsSpec_class_default=null
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref getInt
CONFIG: System Preference Node: /ru/CryptoPro/JCP/Key.PublicKeySpec_class_default=-1
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref get
CONFIG: System Preference Node: /ru/CryptoPro/JCP/tools.SelfTester_jar_names=ru.CryptoPro.JCP.Install.JCPInstaller;ru.CryptoPro.Crypto.JCryptoPInstaller
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref get
CONFIG: System Preference Node: /ru/CryptoPro/JCP/tools.SelfTester_external_classNames=null
12.11.2012 12:44:08 ru.CryptoPro.CAdES.b.d.a <clinit>
INFO: Try to load trusted store cacerts...
12.11.2012 12:44:08 ru.CryptoPro.CAdES.b.d.a a
INFO: Trusted certificates found: 77
12.11.2012 12:44:08 ru.CryptoPro.CAdES.b.d.a <clinit>
INFO: Trusted store cacerts loaded.
12.11.2012 12:44:08 ru.CryptoPro.CAdES.b.d.b a
INFO: Try to build certificate chain...
12.11.2012 12:44:08 ru.CryptoPro.CAdES.b.d.b a
INFO: Building: certificate with serial 163c2a5800000000c61f and issuer: CN=CA ekey.ru, O=ЗАО Удостоверяющий центр, L=Москва, C=RU, EMAILADDRESS=contact@ekey.ru
12.11.2012 12:44:08 ru.CryptoPro.CAdES.b.d.b a
INFO: Building: certificate with serial 210a375e2ba770a84e2d89bb2384f0d9 and issuer: CN=CA ekey.ru, O=ЗАО Удостоверяющий центр, L=Москва, C=RU, EMAILADDRESS=contact@ekey.ru
12.11.2012 12:44:08 ru.CryptoPro.CAdES.b.d.b a
INFO: Certificate chain built.
12.11.2012 12:44:08 ru.CryptoPro.CAdES.b.d.a a
INFO: Verify a certificate chain with size 1 by PKIX...
12.11.2012 12:44:08 ru.CryptoPro.CAdES.b.d.a a
INFO: Certificate path length: 1
12.11.2012 12:44:08 ru.CryptoPro.CAdES.b.d.a a
INFO: Trusted anchor deepth: 1
certpath: PKIXCertPathValidator.engineValidate()...
certpath: PKIXCertPathValidator.engineValidate() reversing certpath...
certpath: PKIXCertPathValidator.engineValidate() anchor.getTrustedCert() != null
certpath: PKIXCertPathValidator.isWorthTrying() checking if this trusted cert is worth trying ...
certpath: YES - try this trustedCert
certpath: anchor.getTrustedCert().getSubjectX500Principal() = CN=CA ekey.ru, O=ЗАО Удостоверяющий центр, L=Москва, C=RU, EMAILADDRESS=contact@ekey.ru
certpath: --------------------------------------------------------------
certpath: Executing PKIX certification path validation algorithm.
certpath: Checking cert1 ...
certpath: Set of critical extensions:
certpath: 2.5.29.15
certpath: 1.2.840.113549.1.9.15
certpath: -Using checker1 ... [sun.security.provider.certpath.AlgorithmChecker]
certpath: -checker1 validation succeeded
certpath: -Using checker2 ... [sun.security.provider.certpath.KeyChecker]
certpath: X509CertSelector.match(SN: 163c2a5800000000c61f
Issuer: CN=CA ekey.ru, O=ЗАО Удостоверяющий центр, L=Москва, C=RU, EMAILADDRESS=contact@ekey.ru
Subject: CN=xxx, T=Разработчик, OU=ДИТ, O=xxx, L=Москва, ST=xxx, C=RU, EMAILADDRESS=xxx, OID.1.2.643.3.131.1.1=1111111111, OID.1.2.840.113549.1.9.2="INN=1111111111")
certpath: X509CertSelector.match returning: true
certpath: -checker2 validation succeeded
certpath: -Using checker3 ... [sun.security.provider.certpath.ConstraintsChecker]
certpath: ---checking basic constraints...
certpath: i = 1
certpath: maxPathLength = 1
certpath: after processing, maxPathLength = 1
certpath: basic constraints verified.
certpath: ---checking name constraints...
certpath: prevNC = null
certpath: newNC = null
certpath: mergedNC = null
certpath: name constraints verified.
certpath: -checker3 validation succeeded
certpath: -Using checker4 ... [sun.security.provider.certpath.PolicyChecker]
certpath: PolicyChecker.checkPolicy() ---checking certificate policies...
certpath: PolicyChecker.checkPolicy() certIndex = 1
certpath: PolicyChecker.checkPolicy() BEFORE PROCESSING: explicitPolicy = 2
certpath: PolicyChecker.checkPolicy() BEFORE PROCESSING: policyMapping = 2
certpath: PolicyChecker.checkPolicy() BEFORE PROCESSING: inhibitAnyPolicy = 2
certpath: PolicyChecker.checkPolicy() BEFORE PROCESSING: policyTree = anyPolicy ROOT
certpath: PolicyChecker.processPolicies() policiesCritical = false
certpath: PolicyChecker.processPolicies() rejectPolicyQualifiers = true
certpath: PolicyChecker.processPolicies() processing policy: 1.2.643.3.8.100.1
certpath: PolicyChecker.processParents(): matchAny = false
certpath: PolicyChecker.processParents(): matchAny = true
certpath: PolicyChecker.processParents() found parent:
anyPolicy ROOT
certpath: PolicyChecker.processPolicies() processing policy: 1.2.643.3.8.100.1.4
certpath: PolicyChecker.processParents(): matchAny = false
certpath: PolicyChecker.processParents(): matchAny = true
certpath: PolicyChecker.processParents() found parent:
anyPolicy ROOT
certpath: PolicyChecker.checkPolicy() AFTER PROCESSING: explicitPolicy = 2
certpath: PolicyChecker.checkPolicy() AFTER PROCESSING: policyMapping = 2
certpath: PolicyChecker.checkPolicy() AFTER PROCESSING: inhibitAnyPolicy = 2
certpath: PolicyChecker.checkPolicy() AFTER PROCESSING: policyTree = anyPolicy ROOT
1.2.643.3.8.100.1 CRIT: false EP: 1.2.643.3.8.100.1 (1)
1.2.643.3.8.100.1.4 CRIT: false EP: 1.2.643.3.8.100.1.4 (1)
certpath: PolicyChecker.checkPolicy() certificate policies verified
certpath: -checker4 validation succeeded
certpath: -Using checker5 ... [sun.security.provider.certpath.BasicChecker]
certpath: ---checking timestamp:Mon Nov 12 12:44:08 GMT+04:00 2012...
certpath: timestamp verified.
certpath: ---checking subject/issuer name chaining...
certpath: subject/issuer name chaining verified.
certpath: ---checking signature...
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref getInt
CONFIG: System Preference Node: /ru/CryptoPro/JCP/tools/CPVerify.DigestStoreDefaultCPVerify_class_WhatRepositoryKeyName=-1
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref get
CONFIG: System Preference Node: /ru/CryptoPro/JCP/tools.UnixMutex_class_pathToLocks=${java.io.tmpdir}\${user.name}
12.11.2012 12:44:08 ru.CryptoPro.JCP.pref.JCPPref getInt
CONFIG: System Preference Node: /ru/CryptoPro/JCP/tools/CPVerify.DigestStoreDefaultCPVerify_class_WhatRepositoryKeyName=-1
12.11.2012 12:44:08 ru.CryptoPro.JCP.tools.z a
INFO: Loading JCP 1.0.52
12.11.2012 12:44:08 ru.CryptoPro.JCP.tools.z a
INFO: JCP loaded.
certpath: signature verified.
certpath: BasicChecker.updateState issuer: CN=CA ekey.ru, O=ЗАО Удостоверяющий центр, L=Москва, C=RU, EMAILADDRESS=contact@ekey.ru; subject: CN=xxx, T=Разработчик, OU=ДИТ, O=xxx, L=Москва, ST=xxx, C=RU, EMAILADDRESS=xxx, OID.1.2.643.3.131.1.1=1111111111, OID.1.2.840.113549.1.9.2="INN=1111111111"; serial#: 105001918456302311360031
certpath: -checker5 validation succeeded
certpath: checking for unresolvedCritExts
12.11.2012 12:44:08 ru.CryptoPro.CAdES.b.d.a a
WARNING: ERROR
java.security.cert.CertPathValidatorException: unrecognized critical extension(s)
at sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:171)
at sun.security.provider.certpath.PKIXCertPathValidator.doValidate(PKIXCertPathValidator.java:328)
at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:178)
at java.security.cert.CertPathValidator.validate(CertPathValidator.java:250)
at ru.CryptoPro.CAdES.b.d.a.a(Unknown Source)
at ru.CryptoPro.CAdES.b.d.a.a(Unknown Source)
at ru.CryptoPro.CAdES.b.d.a.<init>(Unknown Source)
at ru.CryptoPro.CAdES.b.d.a.<init>(Unknown Source)
at ru.CryptoPro.CAdES.CAdESSigner.a(Unknown Source)
at ru.CryptoPro.CAdES.CAdESSignature.a(Unknown Source)
at ru.CryptoPro.CAdES.CAdESSignature.verify(Unknown Source)
12.11.2012 12:44:08 ru.CryptoPro.CAdES.b.d.a a
INFO: Certificate chain is verified by PKIX.
12.11.2012 12:44:09 ru.CryptoPro.CAdES.exception.CAdESException <init>
WARNING: Certificate chain is invalid.
ru.CryptoPro.CAdES.exception.CAdESException: CAdES exception occured: Certificate chain is invalid.
at ru.CryptoPro.CAdES.b.d.a.<init>(Unknown Source)
at ru.CryptoPro.CAdES.b.d.a.<init>(Unknown Source)
at ru.CryptoPro.CAdES.CAdESSigner.a(Unknown Source)
at ru.CryptoPro.CAdES.CAdESSignature.a(Unknown Source)
at ru.CryptoPro.CAdES.CAdESSignature.verify(Unknown Source)
Отредактировано пользователем 12 ноября 2012 г. 17:34:51(UTC)
| Причина: Не указана
|