System.setProperty("http.proxyHost", "proxy.example");
System.setProperty("http.proxyPort", "8080");

java.net.Authenticator.setDefault(new java.net.Authenticator() {
    @Override
    protected java.net.PasswordAuthentication getPasswordAuthentication() {
        if (getRequestorType() == RequestorType.PROXY
                && "proxy.example".equalsIgnoreCase(getRequestingHost())
                && getRequestingPort() == 8080) {
            return new java.net.PasswordAuthentication(
                proxyUser, proxyPassword.toCharArray());
        }
        return null;
    }
});

var signer = new jdk.security.jarsigner.JarSigner.Builder(signingEntry)
    .tsa(java.net.URI.create("http://tsa.example/"))
    .build();

signingEntry አሁን ያለው KeyStore.PrivateKeyEntry ነው። የተኪ መለያ እሴቶችን ከመተግበሪያው የምስክርነት ምንጭ ያቅርቡ፣ ከዚያ ይህን ፈራሚ በመደበኛው ZipFile/የውጤት ፍሰት ሂደት ይጠቀሙ።

የጠያቂ አይነት ማጣሪያ የተኪ እና የመድረሻ ማረጋገጫዎችን ለያይቶ ይይዛል፣ የመድረሻ ተግዳሮት የተኪ የይለፍ ቃል እንዳይቀበል ይከላከላል፤ አስተናጋጅና ወደብ የመካከለኛውን ይገድባሉ።

የስርዓት ባህሪያትና ነባሪው Authenticator መላውን JVM ይነካሉ። በተመሳሳይ ጊዜ በሚሠሩ ስራዎች ዙሪያ ከመቀያየር ይልቅ የህይወት ጊዜያቸውን ሲጀመር ያዘጋጁ።

ይፋዊው jdk.security.jarsigner API የsun.security.tools.jarsigner.Main እና የድሮ tools.jar አቀራረቦችን ያስወግዳል። ምሳሌው HTTP TSA ይጠቀማል፤ HTTPS TSA ደግሞ የራሱን HTTPS መንገድና መደበኛ የማረጋገጫ ፖሊሲ ይፈልጋል።

ተዛማጅ ጽሑፎች