// this never happens, because keystore has been loaded
toArray(newCertificate[0]);
}catch(CertificateExceptionex){
error(rb.getString("Cannot restore certchain from file specified"));
}catch(FileNotFoundExceptionex){
error(rb.getString("File specified by -certchain does not exist"));
}
}else{
try{
cs=store.getCertificateChain(alias);
}catch(KeyStoreExceptionkse){
// this never happens, because keystore has been loaded
}
}
}
if(cs==null){
if(cs==null||cs.length==0){
MessageFormatform=newMessageFormat(rb.getString
if(altCertChain!=null){
("Certificate chain not found for: alias. alias must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain."));
error(rb.getString
Object[]source={alias,alias};
("Certificate chain not found in the file specified."));
error(form.format(source));
}else{
MessageFormatform=newMessageFormat(rb.getString
("Certificate chain not found for: alias. alias must"+
" reference a valid KeyStore key entry containing a"+
" private key and corresponding public key certificate chain."));
Object[]source={alias,alias};
error(form.format(source));
}
}
}
certChain=newX509Certificate[cs.length];
certChain=newX509Certificate[cs.length];
...
@@ -1501,56 +1762,15 @@ public class JarSigner {
...
@@ -1501,56 +1762,15 @@ public class JarSigner {
certChain[i]=(X509Certificate)cs[i];
certChain[i]=(X509Certificate)cs[i];
}
}
// order the cert chain if necessary (put user cert first,
// We don't meant to print anything, the next call
{"Please specify alias name","Please specify alias name"},
{"Only one alias can be specified","Only one alias can be specified"},
{"This jar contains signed entries which is not signed by the specified alias(es).",
"This jar contains signed entries which is not signed by the specified alias(es)."},
{"This jar contains signed entries that's not signed by alias in this keystore.",
"This jar contains signed entries that's not signed by alias in this keystore."},
{"s","s"},
{"s","s"},
{"m","m"},
{"m","m"},
{"k","k"},
{"k","k"},
{"i","i"},
{"i","i"},
{"(and %d more)","(and %d more)"},
{" s = signature was verified ",
{" s = signature was verified ",
" s = signature was verified "},
" s = signature was verified "},
{" m = entry is listed in manifest",
{" m = entry is listed in manifest",
...
@@ -110,7 +126,11 @@ public class JarSignerResources extends java.util.ListResourceBundle {
...
@@ -110,7 +126,11 @@ public class JarSignerResources extends java.util.ListResourceBundle {
" k = at least one certificate was found in keystore"},
" k = at least one certificate was found in keystore"},
{" i = at least one certificate was found in identity scope",
{" i = at least one certificate was found in identity scope",
" i = at least one certificate was found in identity scope"},
" i = at least one certificate was found in identity scope"},
{" X = not signed by specified alias(es)",
" X = not signed by specified alias(es)"},
{"no manifest.","no manifest."},
{"no manifest.","no manifest."},
{"(Signature related entries)","(Signature related entries)"},
{"(Unsigned entries)","(Unsigned entries)"},
{"jar is unsigned. (signatures missing or not parsable)",
{"jar is unsigned. (signatures missing or not parsable)",
"jar is unsigned. (signatures missing or not parsable)"},
"jar is unsigned. (signatures missing or not parsable)"},
{"jar verified.","jar verified."},
{"jar verified.","jar verified."},
...
@@ -134,6 +154,12 @@ public class JarSignerResources extends java.util.ListResourceBundle {
...
@@ -134,6 +154,12 @@ public class JarSignerResources extends java.util.ListResourceBundle {
"unable to instantiate keystore class: "},
"unable to instantiate keystore class: "},
{"Certificate chain not found for: alias. alias must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.",
{"Certificate chain not found for: alias. alias must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.",
"Certificate chain not found for: {0}. {1} must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain."},
"Certificate chain not found for: {0}. {1} must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain."},
{"File specified by -certchain does not exist",
"File specified by -certchain does not exist"},
{"Cannot restore certchain from file specified",
"Cannot restore certchain from file specified"},
{"Certificate chain not found in the file specified.",
"Certificate chain not found in the file specified."},