< prev index next >

src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java

Print this page




 167             searchOptions.add(key);
 168             searchOptions.add("-a");
 169             if (keychainName != null && !keychainName.isEmpty()) {
 170                 searchOptions.add(keychainName);
 171             }
 172 
 173             ProcessBuilder pb = new ProcessBuilder(searchOptions);
 174 
 175             IOUtils.exec(pb, false, ps);
 176             Pattern p = Pattern.compile("\"alis\"<blob>=\"([^\"]+)\"");
 177             Matcher m = p.matcher(baos.toString());
 178             if (!m.find()) {
 179                 Log.error("Did not find a key matching '" + key + "'");
 180                 return null;
 181             }
 182             String matchedKey = m.group(1);
 183             if (m.find()) {
 184                 Log.error("Found more than one key matching '"  + key + "'");
 185                 return null;
 186             }
 187             Log.debug("Using key '" + matchedKey + "'");
 188             return matchedKey;
 189         } catch (IOException ioe) {
 190             Log.verbose(ioe);
 191             return null;
 192         }
 193     }
 194 }


 167             searchOptions.add(key);
 168             searchOptions.add("-a");
 169             if (keychainName != null && !keychainName.isEmpty()) {
 170                 searchOptions.add(keychainName);
 171             }
 172 
 173             ProcessBuilder pb = new ProcessBuilder(searchOptions);
 174 
 175             IOUtils.exec(pb, false, ps);
 176             Pattern p = Pattern.compile("\"alis\"<blob>=\"([^\"]+)\"");
 177             Matcher m = p.matcher(baos.toString());
 178             if (!m.find()) {
 179                 Log.error("Did not find a key matching '" + key + "'");
 180                 return null;
 181             }
 182             String matchedKey = m.group(1);
 183             if (m.find()) {
 184                 Log.error("Found more than one key matching '"  + key + "'");
 185                 return null;
 186             }

 187             return matchedKey;
 188         } catch (IOException ioe) {
 189             Log.verbose(ioe);
 190             return null;
 191         }
 192     }
 193 }
< prev index next >