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 サーバーは、クライアントの現地時間が有効かどうかを確認しますか? そうであれば、証明書の有効期限をどのようにシミュレートできますか? ありがとうございました。