1 /*
   2  * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.security.tools.jarsigner;
  27 
  28 /**
  29  * <p> This class represents the <code>ResourceBundle</code>
  30  * for JarSigner.
  31  *
  32  */
  33 public class Resources extends java.util.ListResourceBundle {
  34 
  35     private static final Object[][] contents = {
  36 
  37         // shared (from jarsigner)
  38         {"SPACE", " "},
  39         {"6SPACE", "      "},
  40         {"COMMA", ", "},
  41 
  42         {"provclass.not.a.provider", "%s not a provider"},
  43         {"provider.name.not.found", "Provider named \"%s\" not found"},
  44         {"provider.class.not.found", "Provider \"%s\" not found"},
  45         {"jarsigner.error.", "jarsigner error: "},
  46         {"Illegal.option.", "Illegal option: "},
  47         {"This.option.is.deprecated", "This option is deprecated: "},
  48         {".keystore.must.be.NONE.if.storetype.is.{0}",
  49                 "-keystore must be NONE if -storetype is {0}"},
  50         {".keypass.can.not.be.specified.if.storetype.is.{0}",
  51                 "-keypass can not be specified if -storetype is {0}"},
  52         {"If.protected.is.specified.then.storepass.and.keypass.must.not.be.specified",
  53                 "If -protected is specified, then -storepass and -keypass must not be specified"},
  54         {"If.keystore.is.not.password.protected.then.storepass.and.keypass.must.not.be.specified",
  55                  "If keystore is not password protected, then -storepass and -keypass must not be specified"},
  56         {"Usage.jarsigner.options.jar.file.alias",
  57                 "Usage: jarsigner [options] jar-file alias"},
  58         {".jarsigner.verify.options.jar.file.alias.",
  59                 "       jarsigner -verify [options] jar-file [alias...]"},
  60         {".keystore.url.keystore.location",
  61                 "[-keystore <url>]           keystore location"},
  62         {".storepass.password.password.for.keystore.integrity",
  63             "[-storepass <password>]     password for keystore integrity"},
  64         {".storetype.type.keystore.type",
  65                 "[-storetype <type>]         keystore type"},
  66         {".keypass.password.password.for.private.key.if.different.",
  67                 "[-keypass <password>]       password for private key (if different)"},
  68         {".certchain.file.name.of.alternative.certchain.file",
  69                 "[-certchain <file>]         name of alternative certchain file"},
  70         {".sigfile.file.name.of.SF.DSA.file",
  71                 "[-sigfile <file>]           name of .SF/.DSA file"},
  72         {".signedjar.file.name.of.signed.JAR.file",
  73                 "[-signedjar <file>]         name of signed JAR file"},
  74         {".digestalg.algorithm.name.of.digest.algorithm",
  75                 "[-digestalg <algorithm>]    name of digest algorithm"},
  76         {".sigalg.algorithm.name.of.signature.algorithm",
  77                 "[-sigalg <algorithm>]       name of signature algorithm"},
  78         {".verify.verify.a.signed.JAR.file",
  79                 "[-verify]                   verify a signed JAR file"},
  80         {".verbose.suboptions.verbose.output.when.signing.verifying.",
  81                 "[-verbose[:suboptions]]     verbose output when signing/verifying."},
  82         {".suboptions.can.be.all.grouped.or.summary",
  83                 "                            suboptions can be all, grouped or summary"},
  84         {".certs.display.certificates.when.verbose.and.verifying",
  85                 "[-certs]                    display certificates when verbose and verifying"},
  86         {".tsa.url.location.of.the.Timestamping.Authority",
  87                 "[-tsa <url>]                location of the Timestamping Authority"},
  88         {".tsacert.alias.public.key.certificate.for.Timestamping.Authority",
  89                 "[-tsacert <alias>]          public key certificate for Timestamping Authority"},
  90         {".tsapolicyid.tsapolicyid.for.Timestamping.Authority",
  91                 "[-tsapolicyid <oid>]        TSAPolicyID for Timestamping Authority"},
  92         {".tsadigestalg.algorithm.of.digest.data.in.timestamping.request",
  93                 "[-tsadigestalg <algorithm>] algorithm of digest data in timestamping request"},
  94         {".altsigner.class.class.name.of.an.alternative.signing.mechanism",
  95                 "[-altsigner <class>]        class name of an alternative signing mechanism\n" +
  96                 "                            (This option has been deprecated.)"},
  97         {".altsignerpath.pathlist.location.of.an.alternative.signing.mechanism",
  98                 "[-altsignerpath <pathlist>] location of an alternative signing mechanism\n" +
  99                 "                            (This option has been deprecated.)"},
 100         {".internalsf.include.the.SF.file.inside.the.signature.block",
 101                 "[-internalsf]               include the .SF file inside the signature block"},
 102         {".sectionsonly.don.t.compute.hash.of.entire.manifest",
 103                 "[-sectionsonly]             don't compute hash of entire manifest"},
 104         {".protected.keystore.has.protected.authentication.path",
 105                 "[-protected]                keystore has protected authentication path"},
 106         {".providerName.name.provider.name",
 107                 "[-providerName <name>]      provider name"},
 108         {".add.provider.option",
 109                 "[-addprovider <name>        add security provider by name (e.g. SunPKCS11)"},
 110         {".providerArg.option.1",
 111                 "  [-providerArg <arg>]] ... configure argument for -addprovider"},
 112         {".providerClass.option",
 113                 "[-providerClass <class>     add security provider by fully-qualified class name"},
 114         {".providerArg.option.2",
 115                 "  [-providerArg <arg>]] ... configure argument for -providerClass"},
 116         {".strict.treat.warnings.as.errors",
 117                 "[-strict]                   treat warnings as errors"},
 118         {".conf.url.specify.a.pre.configured.options.file",
 119                 "[-conf <url>]               specify a pre-configured options file"},
 120         {".print.this.help.message",
 121                 "[-? -h --help]              Print this help message"},
 122         {"Option.lacks.argument", "Option lacks argument"},
 123         {"Please.type.jarsigner.help.for.usage", "Please type jarsigner --help for usage"},
 124         {"Please.specify.jarfile.name", "Please specify jarfile name"},
 125         {"Please.specify.alias.name", "Please specify alias name"},
 126         {"Only.one.alias.can.be.specified", "Only one alias can be specified"},
 127         {"This.jar.contains.signed.entries.which.is.not.signed.by.the.specified.alias.es.",
 128                  "This jar contains signed entries which are not signed by the specified alias(es)."},
 129         {"This.jar.contains.signed.entries.that.s.not.signed.by.alias.in.this.keystore.",
 130                   "This jar contains signed entries that are not signed by alias in this keystore."},
 131         {"s", "s"},
 132         {"m", "m"},
 133         {"k", "k"},
 134         {".and.d.more.", "(and %d more)"},
 135         {".s.signature.was.verified.",
 136                 "  s = signature was verified "},
 137         {".m.entry.is.listed.in.manifest",
 138                 "  m = entry is listed in manifest"},
 139         {".k.at.least.one.certificate.was.found.in.keystore",
 140                 "  k = at least one certificate was found in keystore"},
 141         {".X.not.signed.by.specified.alias.es.",
 142                 "  X = not signed by specified alias(es)"},
 143         {"no.manifest.", "no manifest."},
 144         {".Signature.related.entries.","(Signature related entries)"},
 145         {".Unsigned.entries.", "(Unsigned entries)"},
 146         {"jar.is.unsigned",
 147                 "jar is unsigned."},
 148         {"jar.treated.unsigned",
 149                 "WARNING: Signature is either not parsable or not verifiable, and the jar will be treated as unsigned. For more information, re-run jarsigner with debug enabled (-J-Djava.security.debug=jar)."},
 150         {"jar.treated.unsigned.see.weak",
 151                 "The jar will be treated as unsigned, because it is signed with a weak algorithm that is now disabled.\n\nRe-run jarsigner with the -verbose option for more details."},
 152         {"jar.treated.unsigned.see.weak.verbose",
 153                 "WARNING: The jar will be treated as unsigned, because it is signed with a weak algorithm that is now disabled by the security property:"},
 154         {"jar.signed.", "jar signed."},
 155         {"jar.signed.with.signer.errors.", "jar signed, with signer errors."},
 156         {"jar.verified.", "jar verified."},
 157         {"jar.verified.with.signer.errors.", "jar verified, with signer errors."},
 158 
 159         {"history.with.ts", "- Signed by \"%1$s\"\n    Digest algorithm: %2$s\n    Signature algorithm: %3$s, %4$s\n  Timestamped by \"%6$s\" on %5$tc\n    Timestamp digest algorithm: %7$s\n    Timestamp signature algorithm: %8$s, %9$s"},
 160         {"history.without.ts", "- Signed by \"%1$s\"\n    Digest algorithm: %2$s\n    Signature algorithm: %3$s, %4$s"},
 161         {"history.unparsable", "- Unparsable signature-related file %s"},
 162         {"history.nosf", "- Missing signature-related file META-INF/%s.SF"},
 163         {"history.nobk", "- Missing block file for signature-related file META-INF/%s.SF"},
 164 
 165         {"with.weak", "%s (weak)"},
 166         {"key.bit", "%d-bit key"},
 167         {"key.bit.weak", "%d-bit key (weak)"},
 168         {"unknown.size", "unknown size"},
 169 
 170         {"jarsigner.", "jarsigner: "},
 171         {"signature.filename.must.consist.of.the.following.characters.A.Z.0.9.or.",
 172                 "signature filename must consist of the following characters: A-Z, 0-9, _ or -"},
 173         {"unable.to.open.jar.file.", "unable to open jar file: "},
 174         {"unable.to.create.", "unable to create: "},
 175         {".adding.", "   adding: "},
 176         {".updating.", " updating: "},
 177         {".signing.", "  signing: "},
 178         {"attempt.to.rename.signedJarFile.to.jarFile.failed",
 179                 "attempt to rename {0} to {1} failed"},
 180         {"attempt.to.rename.jarFile.to.origJar.failed",
 181                 "attempt to rename {0} to {1} failed"},
 182         {"unable.to.sign.jar.", "unable to sign jar: "},
 183         {"Enter.Passphrase.for.keystore.", "Enter Passphrase for keystore: "},
 184         {"keystore.load.", "keystore load: "},
 185         {"certificate.exception.", "certificate exception: "},
 186         {"unable.to.instantiate.keystore.class.",
 187                 "unable to instantiate keystore class: "},
 188         {"Certificate.chain.not.found.for.alias.alias.must.reference.a.valid.KeyStore.key.entry.containing.a.private.key.and",
 189                 "Certificate chain not found for: {0}.  {1} must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain."},
 190         {"File.specified.by.certchain.does.not.exist",
 191                 "File specified by -certchain does not exist"},
 192         {"Cannot.restore.certchain.from.file.specified",
 193                 "Cannot restore certchain from file specified"},
 194         {"Certificate.chain.not.found.in.the.file.specified.",
 195                 "Certificate chain not found in the file specified."},
 196         {"found.non.X.509.certificate.in.signer.s.chain",
 197                 "found non-X.509 certificate in signer's chain"},
 198         {"Enter.key.password.for.alias.", "Enter key password for {0}: "},
 199         {"unable.to.recover.key.from.keystore",
 200                 "unable to recover key from keystore"},
 201         {"key.associated.with.alias.not.a.private.key",
 202                 "key associated with {0} not a private key"},
 203         {"you.must.enter.key.password", "you must enter key password"},
 204         {"unable.to.read.password.", "unable to read password: "},
 205         {"certificate.is.valid.from", "certificate is valid from {0} to {1}"},
 206         {"certificate.expired.on", "certificate expired on {0}"},
 207         {"certificate.is.not.valid.until",
 208                 "certificate is not valid until {0}"},
 209         {"certificate.will.expire.on", "certificate will expire on {0}"},
 210         {".Invalid.certificate.chain.", "[Invalid certificate chain: "},
 211         {".Invalid.TSA.certificate.chain.", "[Invalid TSA certificate chain: "},
 212         {"requesting.a.signature.timestamp",
 213                 "requesting a signature timestamp"},
 214         {"TSA.location.", "TSA location: "},
 215         {"TSA.certificate.", "TSA certificate: "},
 216         {"no.response.from.the.Timestamping.Authority.",
 217                 "no response from the Timestamping Authority. When connecting"
 218                 + " from behind a firewall an HTTP or HTTPS proxy may need to"
 219                 + " be specified. Supply the following options to jarsigner:"},
 220         {"or", "or"},
 221         {"Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the",
 222                 "Certificate not found for: {0}.  {1} must reference a valid KeyStore entry containing an X.509 public key certificate for the Timestamping Authority."},
 223         {"using.an.alternative.signing.mechanism",
 224                 "using an alternative signing mechanism"},
 225         {"entry.was.signed.on", "entry was signed on {0}"},
 226         {"Warning.", "Warning: "},
 227         {"Error.", "Error: "},
 228         {"...Signer", ">>> Signer"},
 229         {"...TSA", ">>> TSA"},
 230         {"trusted.certificate", "trusted certificate"},
 231         {"This.jar.contains.unsigned.entries.which.have.not.been.integrity.checked.",
 232                 "This jar contains unsigned entries which have not been integrity-checked. "},
 233         {"This.jar.contains.entries.whose.signer.certificate.has.expired.",
 234                 "This jar contains entries whose signer certificate has expired. "},
 235         {"This.jar.contains.entries.whose.signer.certificate.will.expire.within.six.months.",
 236                 "This jar contains entries whose signer certificate will expire within six months. "},
 237         {"This.jar.contains.entries.whose.signer.certificate.is.not.yet.valid.",
 238                 "This jar contains entries whose signer certificate is not yet valid. "},
 239         {"This.jar.contains.entries.whose.signer.certificate.is.self.signed.",
 240                 "This jar contains entries whose signer certificate is self-signed."},
 241         {"Re.run.with.the.verbose.and.certs.options.for.more.details.",
 242                 "Re-run with the -verbose and -certs options for more details."},
 243         {"The.signer.certificate.has.expired.",
 244                 "The signer certificate has expired."},
 245         {"The.timestamp.expired.1.but.usable.2",
 246                 "The timestamp expired on %1$tY-%1$tm-%1$td. However, the JAR will be valid until the signer certificate expires on %2$tY-%2$tm-%2$td."},
 247         {"The.timestamp.has.expired.",
 248                 "The timestamp has expired."},
 249         {"The.signer.certificate.will.expire.within.six.months.",
 250                 "The signer certificate will expire within six months."},
 251         {"The.timestamp.will.expire.within.one.year.on.1",
 252                 "The timestamp will expire within one year on %1$tY-%1$tm-%1$td."},
 253         {"The.timestamp.will.expire.within.one.year.on.1.but.2",
 254                 "The timestamp will expire within one year on %1$tY-%1$tm-%1$td. However, the JAR will be valid until the signer certificate expires on %2$tY-%2$tm-%2$td."},
 255         {"The.signer.certificate.is.not.yet.valid.",
 256                 "The signer certificate is not yet valid."},
 257         {"The.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
 258                  "The signer certificate's KeyUsage extension doesn't allow code signing."},
 259         {"The.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
 260                  "The signer certificate's ExtendedKeyUsage extension doesn't allow code signing."},
 261         {"The.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
 262                  "The signer certificate's NetscapeCertType extension doesn't allow code signing."},
 263         {"This.jar.contains.entries.whose.signer.certificate.s.KeyUsage.extension.doesn.t.allow.code.signing.",
 264                  "This jar contains entries whose signer certificate's KeyUsage extension doesn't allow code signing."},
 265         {"This.jar.contains.entries.whose.signer.certificate.s.ExtendedKeyUsage.extension.doesn.t.allow.code.signing.",
 266                  "This jar contains entries whose signer certificate's ExtendedKeyUsage extension doesn't allow code signing."},
 267         {"This.jar.contains.entries.whose.signer.certificate.s.NetscapeCertType.extension.doesn.t.allow.code.signing.",
 268                  "This jar contains entries whose signer certificate's NetscapeCertType extension doesn't allow code signing."},
 269         {".{0}.extension.does.not.support.code.signing.",
 270                  "[{0} extension does not support code signing]"},
 271         {"The.signer.s.certificate.chain.is.invalid.reason.1",
 272                 "The signer's certificate chain is invalid. Reason: %s"},
 273         {"The.tsa.certificate.chain.is.invalid.reason.1",
 274                 "The TSA certificate chain is invalid. Reason: %s"},
 275         {"The.signer.s.certificate.is.self.signed.",
 276                 "The signer's certificate is self-signed."},
 277         {"The.1.algorithm.specified.for.the.2.option.is.considered.a.security.risk.",
 278                 "The %1$s algorithm specified for the %2$s option is considered a security risk."},
 279         {"The.1.signing.key.has.a.keysize.of.2.which.is.considered.a.security.risk.",
 280                 "The %1$s signing key has a keysize of %2$d which is considered a security risk."},
 281         {"This.jar.contains.entries.whose.certificate.chain.is.invalid.reason.1",
 282                  "This jar contains entries whose certificate chain is invalid. Reason: %s"},
 283         {"This.jar.contains.entries.whose.tsa.certificate.chain.is.invalid.reason.1",
 284                 "This jar contains entries whose TSA certificate chain is invalid. Reason: %s"},
 285         {"no.timestamp.signing",
 286                 "No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (%1$tY-%1$tm-%1$td)."},
 287         {"invalid.timestamp.signing",
 288                 "The timestamp is invalid. Without a valid timestamp, users may not be able to validate this jar after the signer certificate's expiration date (%1$tY-%1$tm-%1$td)."},
 289         {"no.timestamp.verifying",
 290                 "This jar contains signatures that do not include a timestamp. Without a timestamp, users may not be able to validate this jar after any of the signer certificates expire (as early as %1$tY-%1$tm-%1$td)."},
 291         {"bad.timestamp.verifying",
 292                 "This jar contains signatures that include an invalid timestamp. Without a valid timestamp, users may not be able to validate this jar after any of the signer certificates expire (as early as %1$tY-%1$tm-%1$td).\nRerun jarsigner with -J-Djava.security.debug=jar for more information."},
 293         {"The.signer.certificate.will.expire.on.1.",
 294                 "The signer certificate will expire on %1$tY-%1$tm-%1$td."},
 295         {"The.timestamp.will.expire.on.1.",
 296                 "The timestamp will expire on %1$tY-%1$tm-%1$td."},
 297         {"signer.cert.expired.1.but.timestamp.good.2.",
 298                 "The signer certificate expired on %1$tY-%1$tm-%1$td. However, the JAR will be valid until the timestamp expires on %2$tY-%2$tm-%2$td."},
 299         {"Unknown.password.type.", "Unknown password type: "},
 300         {"Cannot.find.environment.variable.",
 301                 "Cannot find environment variable: "},
 302         {"Cannot.find.file.", "Cannot find file: "},
 303     };
 304 
 305     /**
 306      * Returns the contents of this <code>ResourceBundle</code>.
 307      *
 308      * <p>
 309      *
 310      * @return the contents of this <code>ResourceBundle</code>.
 311      */
 312     @Override
 313     public Object[][] getContents() {
 314         return contents;
 315     }
 316 }