Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 jdk.jpackage.jmod - JPackage Tool
JDK 17 jdk.jpackage.jmod is the JMOD file for JDK 17 JPackage tool,
which can be invoked by the "jpackage" command.
JDK 17 JPackage tool compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jpackage.jmod.
JDK 17 JPackage tool compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JPackage tool source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.jpackage.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/jpackage/internal/MacCertificate.java
/*
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package jdk.jpackage.internal;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.file.StandardCopyOption;
import java.nio.file.Files;
import java.nio.file.Path;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
public final class MacCertificate {
private final String certificate;
public MacCertificate(String certificate) {
this.certificate = certificate;
}
public boolean isValid() {
return verifyCertificate(this.certificate);
}
private static Path findCertificate(String certificate) {
Path result = null;
List<String> args = new ArrayList<>();
args.add("/usr/bin/security");
args.add("find-certificate");
args.add("-c");
args.add(certificate);
args.add("-a");
args.add("-p");
try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos)) {
ProcessBuilder security = new ProcessBuilder(args);
IOUtils.exec(security, false, ps);
Path output = Files.createTempFile("tempfile", ".tmp");
Files.copy(new ByteArrayInputStream(baos.toByteArray()),
output, StandardCopyOption.REPLACE_EXISTING);
result = output;
}
catch (IOException ignored) {}
return result;
}
private static Date findCertificateDate(String filename) {
Date result = null;
List<String> args = new ArrayList<>();
args.add("/usr/bin/openssl");
args.add("x509");
args.add("-noout");
args.add("-enddate");
args.add("-in");
args.add(filename);
try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos)) {
ProcessBuilder security = new ProcessBuilder(args);
IOUtils.exec(security, false, ps);
String output = baos.toString();
output = output.substring(output.indexOf("=") + 1);
DateFormat df = new SimpleDateFormat(
"MMM dd kk:mm:ss yyyy z", Locale.ENGLISH);
result = df.parse(output);
} catch (IOException | ParseException ex) {
Log.verbose(ex);
}
return result;
}
private static boolean verifyCertificate(String certificate) {
boolean result = false;
try {
Path file = null;
Date certificateDate = null;
try {
file = findCertificate(certificate);
if (file != null) {
certificateDate = findCertificateDate(
file.toFile().getCanonicalPath());
}
}
finally {
if (file != null) {
Files.delete(file);
}
}
if (certificateDate != null) {
Calendar c = Calendar.getInstance();
Date today = c.getTime();
if (certificateDate.after(today)) {
result = true;
}
}
}
catch (IOException ignored) {}
return result;
}
}
⏎ jdk/jpackage/internal/MacCertificate.java
Or download all of them as a single archive file:
File name: jdk.jpackage-17.0.5-src.zip File size: 92069 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jshell.jmod - JShell Tool
2023-08-03, ∼8725🔥, 0💬
Popular Posts:
Old version of xml-apis.jar. JAR File Size and Download Location: File name: xmlParserAPIs.jar File ...
JDK 17 java.base.jmod is the JMOD file for JDK 17 Base module. JDK 17 Base module compiled class fil...
Apache Neethi provides general framework for the programmers to use WS Policy. It is compliant with ...
Apache ZooKeeper is an open-source server which enables highly reliable distributed coordination. Ap...
JSP(tm) Standard Tag Library 1.1 implementation - Jakarta Taglibs hosts the Standard Taglib 1.1, an ...