30
30
31
31
public class SigningBase {
32
32
33
- public static String DEV_NAME = "jpackage.openjdk.java.net" ;
34
- public static String APP_CERT
35
- = "Developer ID Application: " + DEV_NAME ;
36
- public static String INSTALLER_CERT
37
- = "Developer ID Installer: " + DEV_NAME ;
38
- public static String KEYCHAIN = "jpackagerTest.keychain" ;
33
+ public static String DEV_NAME ;
34
+ public static String APP_CERT ;
35
+ public static String INSTALLER_CERT ;
36
+ public static String KEYCHAIN ;
37
+ static {
38
+ String value = System .getProperty ("jpackage.mac.signing.key.user.name" );
39
+ DEV_NAME = (value == null ) ? "jpackage.openjdk.java.net" : value ;
40
+ APP_CERT = "Developer ID Application: " + DEV_NAME ;
41
+ INSTALLER_CERT = "Developer ID Installer: " + DEV_NAME ;
42
+ value = System .getProperty ("jpackage.mac.signing.keychain" );
43
+ KEYCHAIN = (value == null ) ? "jpackagerTest.keychain" : value ;
44
+ }
39
45
40
46
private static void checkString (List <String > result , String lookupString ) {
41
47
TKit .assertTextStream (lookupString ).predicate (
42
- (line , what ) -> line .trim ().equals (what )).apply (result .stream ());
48
+ (line , what ) -> line .trim ().contains (what )).apply (result .stream ());
43
49
}
44
50
45
51
private static List <String > codesignResult (Path target , boolean signed ) {
@@ -92,8 +98,6 @@ private static void verifySpctlResult(List<String> output, Path target,
92
98
if (exitCode == 0 ) {
93
99
lookupString = target .toString () + ": accepted" ;
94
100
checkString (output , lookupString );
95
- lookupString = "source=" + DEV_NAME ;
96
- checkString (output , lookupString );
97
101
} else if (exitCode == 3 ) {
98
102
// allow failure purely for not being notarized
99
103
lookupString = target .toString () + ": rejected" ;
@@ -120,7 +124,7 @@ private static List<String> pkgutilResult(Path target) {
120
124
121
125
private static void verifyPkgutilResult (List <String > result ) {
122
126
result .stream ().forEachOrdered (TKit ::trace );
123
- String lookupString = "Status: signed by a certificate trusted for current user " ;
127
+ String lookupString = "Status: signed by" ;
124
128
checkString (result , lookupString );
125
129
lookupString = "1. " + INSTALLER_CERT ;
126
130
checkString (result , lookupString );
0 commit comments