1

CA (Thawte) からのコード署名証明書を使用して Java Web Start アプリに署名しました。証明書の有効期限が切れた後も有効になるように、署名にはタイムスタンプが付けられます (-tca https://timestamp.geotrust.com/tsa引数を jarsigner ツールに渡します)。現在、証明書が有効な場合、アプリは完全に機能します。しかし、証明書の有効期限をシミュレートするために現地時間を進めようとすると、アプリは起動しません。次の例外が発生します。

java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Responder's certificate not within the validity period
at com.sun.deploy.security.RevocationChecker.checkOCSP(Unknown Source)
at com.sun.deploy.security.RevocationChecker.check(Unknown Source)
at com.sun.deploy.security.TrustDecider.checkRevocationStatus(Unknown Source)
at com.sun.deploy.security.TrustDecider.getValidationState(Unknown Source)
at com.sun.deploy.security.TrustDecider.validateChain(Unknown Source)
at com.sun.deploy.security.TrustDecider.isAllPermissionGrantedInt(Unknown Source)
at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
at com.sun.javaws.security.AppPolicy.grantUnrestrictedAccess(Unknown Source)
at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)
at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)
at com.sun.javaws.Launcher.prepareResources(Unknown Source)
at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main.access$000(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.cert.CertPathValidatorException: Responder's certificate not within the validity period
at sun.security.provider.certpath.OCSPResponse.verify(Unknown Source)
at sun.security.provider.certpath.OCSP.check(Unknown Source)
at sun.security.provider.certpath.OCSP.check(Unknown Source)
at sun.security.provider.certpath.OCSP.check(Unknown Source)
at com.sun.deploy.security.RevocationChecker$2.run(Unknown Source)
at com.sun.deploy.security.RevocationChecker$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.RevocationChecker.doPrivilegedOCSPCheck(Unknown Source)
... 20 more
Caused by: java.security.cert.CertificateExpiredException: NotAfter: Thu Dec 17 00:59:59 CET 2015
at sun.security.x509.CertificateValidity.valid(Unknown Source)
at sun.security.x509.X509CertImpl.checkValidity(Unknown Source)
... 28 more

この証明書は、2015 年 9 月 10 日から 2017 年 8 月 11 日まで有効です。

署名済みの JAR を jarsigner ツールで検証しようとしました。すべてのファイルにタイムスタンプがあるようです:

      [entry was signed on 9.10.15 16:42]
  X.509, CN="GEOVAP, spol. s.r.o.", OU=Software, O="GEOVAP, spol. s.r.o.", L=Pardubice, ST=Czech Republic, C=CZ
  [certificate is valid from 9.10.15 2:00 to 8.11.17 0:59]
  X.509, CN=thawte SHA256 Code Signing CA, O="thawte, Inc.", C=US
  [certificate is valid from 10.12.13 1:00 to 10.12.23 0:59]

したがって、jarsigner の出力は正しいようです。これが署名にタイムスタンプがあることを本当に意味することを誰かが確認できますか?

現地時間を数 (3) 日前に変更すると、アプリが機能することに気付きました。しかし、それをさらに (週) 変更すると、例外が発生します。CA サーバーは、クライアントの現地時間が有効かどうかを確認しますか? そうであれば、証明書の有効期限をどのようにシミュレートできますか? ありがとうございました。

4

2 に答える 2

2

JDK keytool を使用してタイムスタンプを確認することもできます。

keytool -printcert -jarfile app.jar

タイムスタンプ レポートは次のようになります。

    Timestamp:

Owner: CN=GeoTrust 2048-bit Timestamping Signer 1, O=GeoTrust Inc, C=US
Issuer: CN=Symantec Time Stamping Services CA - G2, O=Symantec Corporation, C=US
Serial number: 5fd693fab098e3f4677bb8cb672c229e
Valid from: Thu Jun 11 02:00:00 CEST 2015 until: Wed Dec 30 00:59:59 CET 2020
Certificate fingerprints:
     MD5:  2B:51:8D:A4:11:F1:43:C7:84:62:5A:41:95:BB:5E:05
     SHA1: D7:1D:45:62:C6:33:36:7C:34:E3:66:CF:B7:6F:B9:7B:05:AF:34:B4
     SHA256: DC:DA:D2:91:F5:32:D5:BD:FC:E6:9D:06:41:A1:45:57:85:74:E0:D5:B9:8F:19:00:6C:19:AB:2E:9D:F9:96:42
     Signature algorithm name: SHA1withRSA
     Version: 3
于 2015-10-12T16:02:53.313 に答える