Статус: Участник
Группы: Участники
Зарегистрирован: 29.05.2014(UTC) Сообщений: 18
Сказал(а) «Спасибо»: 1 раз
|
Спасибо. Все прошло успешно после изменения типа подписи при проверке. Теперь пытаюсь подписать тот же файл тем же сертификатом, но уже типом CAdESType.CAdES_BES вместо CAdESType.CAdES_X_Long_Type_1 И получаю ошибку при подписании: Цитата: WARNING: ERROR java.security.cert.CertPathValidatorException: Could not determine revocation status: unable to find valid certification path to requested target at sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:159) at sun.security.provider.certpath.PKIXCertPathValidator.doValidate(PKIXCertPathValidator.java:351) at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:191) at java.security.cert.CertPathValidator.validate(CertPathValidator.java:279) at ru.CryptoPro.reprov.CPCertPathValidator.engineValidate(Unknown Source) at java.security.cert.CertPathValidator.validate(CertPathValidator.java:279) at ru.CryptoPro.CAdES.b.d.a.a(Unknown Source) at ru.CryptoPro.CAdES.b.d.a.a(Unknown Source) at ru.CryptoPro.CAdES.CAdESSignature.addSigner(Unknown Source) at ru.CryptoPro.CAdES.CAdESSignature.addSigner(Unknown Source) at ru.CryptoPro.CAdES.CAdESSignature.addSigner(Unknown Source) at ru.mdi.irmdev.elib.crypt.CadesServiceImpl.sign(CadesServiceImpl.java:87) at ru.mdi.irmdev.elib.crypt.CadesServiceImpl.sign(CadesServiceImpl.java:511) at ru.mdi.irmdev.elib.JCPCryptServiceTest.testSignAndVerify(JCPCryptServiceTest.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196) at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268) at ru.CryptoPro.reprov.CrlRevocationChecker.a(Unknown Source) at ru.CryptoPro.reprov.CrlRevocationChecker.a(Unknown Source) at ru.CryptoPro.reprov.CrlRevocationChecker.a(Unknown Source) at ru.CryptoPro.reprov.CrlRevocationChecker.a(Unknown Source) at ru.CryptoPro.reprov.CrlRevocationChecker.check(Unknown Source) at sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:133) ... 39 more
июн 05, 2014 10:39:50 AM ru.CryptoPro.CAdES.b.d.a a FINE: %%% Certificate chain is verified %%% июн 05, 2014 10:39:50 AM ru.CryptoPro.CAdES.exception.CAdESException <init> SEVERE: Status of the signer certificate Sn 1efe6f97000000009afa issued by CN="УЦ ОАО \"Электронная Москва\"", O="ОАО \"Электронная Москва\"", L=Москва, ST=77 г. Москва, C=RU, EMAILADDRESS=e-moskva@e-moskva.ru, STREET="Б.Сухаревский пер,д11,стр1,оф6", OID.1.2.643.3.131.1.1=#120C303037373037333134303239, OID.1.2.643.100.1=#120D31303237373037303133383036 is UNKNOWN or REVOKED ERROR 05.06.2014 10:39:50,219 main (ru.mdi.irmdev.elib.crypt.JCPCryptService.sign():95) [] - sign: Failed to sign data, throw
Status of the signer certificate Sn 1efe6f97000000009afa issued by CN="УЦ ОАО \"Электронная Москва\"", O="ОАО \"Электронная Москва\"", L=Москва, ST=77 г. Москва, C=RU, EMAILADDRESS=e-moskva@e-moskva.ru, STREET="Б.Сухаревский пер,д11,стр1,оф6", OID.1.2.643.3.131.1.1=#120C303037373037333134303239, OID.1.2.643.100.1=#120D31303237373037303133383036 is UNKNOWN or REVOKED, errors: 'Certificate is revoked' (18) or 'Certificate status is unknown' (19) at ru.CryptoPro.CAdES.CAdESSignature.addSigner(Unknown Source) at ru.CryptoPro.CAdES.CAdESSignature.addSigner(Unknown Source) at ru.CryptoPro.CAdES.CAdESSignature.addSigner(Unknown Source) at ru.mdi.irmdev.elib.crypt.CadesServiceImpl.sign(CadesServiceImpl.java:87) at ru.mdi.irmdev.elib.crypt.CadesServiceImpl.sign(CadesServiceImpl.java:511) at ru.mdi.irmdev.elib.JCPCryptServiceTest.testSignAndVerify(JCPCryptServiceTest.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
ru.mdi.irmdev.elib.crypt.CryptSignException: Failed to sign data at ru.mdi.irmdev.elib.crypt.CadesServiceImpl.sign(CadesServiceImpl.java:96) at ru.mdi.irmdev.elib.crypt.CadesServiceImpl.sign(CadesServiceImpl.java:511) at ru.mdi.irmdev.elib.JCPCryptServiceTest.testSignAndVerify(JCPCryptServiceTest.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: Status of the signer certificate Sn 1efe6f97000000009afa issued by CN="УЦ ОАО \"Электронная Москва\"", O="ОАО \"Электронная Москва\"", L=Москва, ST=77 г. Москва, C=RU, EMAILADDRESS=e-moskva@e-moskva.ru, STREET="Б.Сухаревский пер,д11,стр1,оф6", OID.1.2.643.3.131.1.1=#120C303037373037333134303239, OID.1.2.643.100.1=#120D31303237373037303133383036 is UNKNOWN or REVOKED, errors: 'Certificate is revoked' (18) or 'Certificate status is unknown' (19) at ru.CryptoPro.CAdES.CAdESSignature.addSigner(Unknown Source) at ru.CryptoPro.CAdES.CAdESSignature.addSigner(Unknown Source) at ru.CryptoPro.CAdES.CAdESSignature.addSigner(Unknown Source) at ru.mdi.irmdev.elib.crypt.CadesServiceImpl.sign(CadesServiceImpl.java:87) ... 28 more
Часть кода: Цитата: System.setProperty("http.proxyHost", "proxy.mdi.ru"); System.setProperty("http.proxyPort", "3128");
System.setProperty("ru.CryptoPro.reprov.enableCRLDP", "true"); System.setProperty("com.sun.security.enableCRLDP", "true"); // для sun jvm System.setProperty("com.ibm.security.enableCRLDP", "true"); // или ibm jvm
System.setProperty("ru.cryptopro.notThrowIfChainIsInvalid", "true"); System.setProperty("ocsp.enable", "false");
... Collection<X509Certificate> chain = new ArrayList<X509Certificate>(); PrivateKey privateKey = loadConfiguration(storeName, key, password, chain);
CAdESSignature cadesSignature = new CAdESSignature(false); cadesSignature.addSigner(privateKey, chain, CAdESType.CAdES_BES, tsaUrl);
Вложение(я): ![](/forum2/Themes/soclean/icon_file.gif) jcp.zip (11kb) загружен 2 раз(а).У Вас нет прав для просмотра или загрузки вложений. Попробуйте зарегистрироваться.
|