При использовании метода enhance для усовершенствования CAdES-BES до CAdES-T или CAdES-X Long Type 1 (тоже самое с xades)
в логах уровня DEBUG видно исключение java.lang.IllegalArgumentException: The key cannot be null
Исключение возникает при первой загрузки CRL и игнорируется, потом сразу происходит повторная попытка, которая проходит успешно
В режиме debag видно, что данный параметр key всегда null и заполняется только при дальнейшей обработки
в итоге подпись усовершенствуется успешно
Вопрос: так и должно работать или этого исключения не должно быть в процессе усовершенствования ?
DEBUG
2022-06-15 15:14:52.889 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.verifyRevocationStatus() ---checking revocation status...
2022-06-15 15:14:52.912 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ENTRY
2022-06-15 15:14:52.915 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : RETURN
2022-06-15 15:14:52.925 INFO 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : User Preference Node: /ru/CryptoPro/reprov/certpath.allow_crl_redirect=false
2022-06-15 15:14:52.925 INFO 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : User Preference Node: /ru/CryptoPro/reprov/certpath.use_default_jsse_impl=true
2022-06-15 15:14:52.925 INFO 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : User Preference Node: /ru/CryptoPro/reprov/certpath.use_jsse_impl=null
2022-06-15 15:14:52.926 INFO 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : User Preference Node: /ru/CryptoPro/reprov/certpath.use_jsse_alg=null
2022-06-15 15:14:52.926 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CertStore URI:
http://testca2012.crypto...8d14f28cbb1f212f5c3a.crl2022-06-15 15:14:52.929 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : Connecting:
http://testca2012.crypto...8d14f28cbb1f212f5c3a.crl2022-06-15 15:14:52.979 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : Downloading new CRL...
2022-06-15 15:14:52.992 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : Exception verifying CRL:
java.lang.IllegalArgumentException: The key cannot be null
at ru.CryptoPro.reprov.certpath.DisabledAlgorithmConstraints.a(Unknown Source) ~[JCPRevCheck-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.reprov.certpath.DisabledAlgorithmConstraints.permits(Unknown Source) ~[JCPRevCheck-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.reprov.certpath.AlgorithmChecker.a(Unknown Source) ~[JCPRevCheck-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.reprov.certpath.AlgorithmChecker.a(Unknown Source) ~[JCPRevCheck-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.reprov.certpath.DistributionPointFetcher.a(Unknown Source) ~[JCPRevCheck-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.reprov.certpath.DistributionPointFetcher.a(Unknown Source) ~[JCPRevCheck-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.reprov.certpath.DistributionPointFetcher.getCRLs(Unknown Source) ~[JCPRevCheck-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.reprov.certpath.CrlRevocationChecker.a(Unknown Source) ~[JCPRevCheck-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.reprov.certpath.CrlRevocationChecker.a(Unknown Source) ~[JCPRevCheck-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.reprov.certpath.CrlRevocationChecker.check(Unknown Source) ~[JCPRevCheck-jcp-2.0.41940-A.jar:41940-A]
at sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:125) ~[?:?]
at sun.security.provider.certpath.PKIXCertPathValidator.validate(PKIXCertPathValidator.java:224) ~[?:?]
at sun.security.provider.certpath.PKIXCertPathValidator.validate(PKIXCertPathValidator.java:144) ~[?:?]
at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:83) ~[?:?]
at java.security.cert.CertPathValidator.validate(CertPathValidator.java:309) ~[?:?]
at ru.CryptoPro.reprov.CPCertPathValidator.engineValidate(Unknown Source) ~[JCPRevCheck-jcp-2.0.41940-A.jar:41940-A]
at java.security.cert.CertPathValidator.validate(CertPathValidator.java:309) ~[?:?]
at ru.CryptoPro.AdES.certificate.BaseCertificateChainValidatorImpl.validate(Unknown Source) ~[AdES-core-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.AdES.certificate.BaseCertificateChainValidatorImpl.validate(Unknown Source) ~[AdES-core-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.AdES.certificate.BaseCertificateChainValidatorImpl.validate(Unknown Source) ~[AdES-core-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.AdES.external.signature.AdESSigner.validate(Unknown Source) ~[AdES-core-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.CAdES.CAdESSignerPKCS7Impl.verify(Unknown Source) ~[CAdES-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.CAdES.CAdESSignerBESImpl.verify(Unknown Source) ~[CAdES-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.CAdES.CAdESSignerPKCS7Impl.verify(Unknown Source) ~[CAdES-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.CAdES.timestamp.external.InternalTimeStampValidationProcessImpl.validate(Unknown Source) ~[CAdES-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.AdES.timestamp.TSPTimeStampValidatorImpl.validate(Unknown Source) ~[AdES-core-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.AdES.timestamp.TSPTimeStampValidatorImpl.validate(Unknown Source) ~[AdES-core-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.CAdES.pc_2.pc_0.cl_7.a(Unknown Source) ~[CAdES-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.CAdES.pc_2.pc_0.cl_7.getAttributes(Unknown Source) ~[CAdES-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.CAdES.pc_2.pc_0.cl_5.getAttributes(Unknown Source) ~[CAdES-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.CAdES.pc_2.pc_0.cl_8.getAttributes(Unknown Source) ~[CAdES-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.CAdES.CAdESSignerBESImpl.enhance(Unknown Source) ~[CAdES-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.CAdES.CAdESSignerBESImpl.enhance(Unknown Source) ~[CAdES-jcp-2.0.41940-A.jar:41940-A]
at ru.CryptoPro.CAdES.CAdESSignerBESImpl.enhance(Unknown Source) ~[CAdES-jcp-2.0.41940-A.jar:41940-A]
at bars.rtn.crypto.services.CryptoService.enhanceSignatureCAdES(CryptoService.java:137) ~[classes/:?]
2022-06-15 15:14:52.996 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : Returning 0 CRLs
2022-06-15 15:14:52.996 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.verifyRevocationStatus() crls.size() = 0
2022-06-15 15:14:52.996 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.verifyRevocationStatus() approved crls.size() = 0
2022-06-15 15:14:52.996 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.verifyWithSeparateSigningKey() ---checking revocation status...
2022-06-15 15:14:52.997 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.buildToNewKey() starting work
2022-06-15 15:14:52.997 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.buildToNewKey() about to try build ...
2022-06-15 15:14:52.998 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : RejectCertSelector.match: returning true
2022-06-15 15:14:52.998 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.buildToNewKey() about to check revocation ...
2022-06-15 15:14:52.998 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.buildToNewKey() got key ru.CryptoPro.JCP.Key.GostPublicKey
2022-06-15 15:14:52.998 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.verifyRevocationStatus() ---checking revocation status...
2022-06-15 15:14:52.999 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CertStore URI:
http://testca2012.crypto...8d14f28cbb1f212f5c3a.crl2022-06-15 15:14:53.000 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : URICertStore.getInstance: cache hit
2022-06-15 15:14:53.000 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : Returning CRL from cache
2022-06-15 15:14:53.000 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ENTRY
2022-06-15 15:14:53.000 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : RETURN
2022-06-15 15:14:53.001 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ENTRY
2022-06-15 15:14:53.004 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : RETURN
2022-06-15 15:14:53.005 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : Returning 1 CRLs
2022-06-15 15:14:53.005 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.verifyRevocationStatus() crls.size() = 0
2022-06-15 15:14:53.006 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.verifyRevocationStatus() approved crls.size() = 1
2022-06-15 15:14:53.006 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : starting the final sweep...
2022-06-15 15:14:53.006 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.verifyRevocationStatus cert SN: 3f898850071ade18c4d7b4b46c57f1542
2022-06-15 15:14:53.007 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ***ms = 196 611
2022-06-15 15:14:53.008 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ***msVerify
2022-06-15 15:14:53.008 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ***rfcVerify
2022-06-15 15:14:53.008 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ***ok
2022-06-15 15:14:53.010 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ***ok
2022-06-15 15:14:53.010 TRACE 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ENTRY
2022-06-15 15:14:53.011 TRACE 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : RETURN
2022-06-15 15:14:53.011 TRACE 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ENTRY
2022-06-15 15:14:53.011 TRACE 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : RETURN
2022-06-15 15:14:53.011 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.verifyRevocationStatus() ---checking revocation status...
2022-06-15 15:14:53.012 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ENTRY
2022-06-15 15:14:53.015 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : RETURN
2022-06-15 15:14:53.016 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CertStore URI:
http://testca2012.crypto...0f9e1379ebfc20fe9e2f.crl2022-06-15 15:14:53.017 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : Connecting:
http://testca2012.crypto...0f9e1379ebfc20fe9e2f.crl2022-06-15 15:14:54.101 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : Downloading new CRL...
2022-06-15 15:14:54.489 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ENTRY
2022-06-15 15:14:54.490 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : RETURN
2022-06-15 15:14:54.490 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ENTRY
2022-06-15 15:14:54.495 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : RETURN
2022-06-15 15:14:54.496 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : Returning 1 CRLs
2022-06-15 15:14:54.496 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.verifyRevocationStatus() crls.size() = 0
2022-06-15 15:14:54.496 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.verifyRevocationStatus() approved crls.size() = 1
2022-06-15 15:14:54.497 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : starting the final sweep...
2022-06-15 15:14:54.497 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : CrlRevocationChecker.verifyRevocationStatus cert SN: 342dc8a0071adbd9b441ed9a8fa9cae22
2022-06-15 15:14:54.497 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ***ms = 196 611
2022-06-15 15:14:54.497 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ***msVerify
2022-06-15 15:14:54.497 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ***rfcVerify
2022-06-15 15:14:54.498 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ***ok
2022-06-15 15:14:54.498 DEBUG 5102 --- [nio-8888-exec-2] r.C.J.t.JCPLogger : ***ok