0
package org.apache.commons.net.util;

import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;

public final class TrustManagerUtils {

   private static final X509TrustManager ACCEPT_ALL=null;
   private static final X509TrustManager CHECK_SERVER_VALIDITY=null;
   private static final X509Certificate[] EMPTY_X509CERTIFICATE_ARRAY=null;


   static void method_59() {
      EMPTY_X509CERTIFICATE_ARRAY = new X509Certificate[0];
      TrustManagerUtils.TrustManager var10000 = new TrustManagerUtils.TrustManager;
      var10000.method_400(false);
      ACCEPT_ALL = var10000;
      var10000 = new TrustManagerUtils.TrustManager;
      var10000.method_400(true);
      CHECK_SERVER_VALIDITY = var10000;
   }


   public void method_60() {
    //.method_60();
   }

   public static X509TrustManager getAcceptAllTrustManager() {
      return ACCEPT_ALL;
   }

   public static X509TrustManager getDefaultTrustManager(KeyStore var0) throws GeneralSecurityException {
      TrustManagerFactory var1 = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
      var1.init(var0);
      return (X509TrustManager)var1.getTrustManagers()[0];
   }

   public static X509TrustManager getValidateServerCertificateTrustManager() {
      return CHECK_SERVER_VALIDITY;
   }

   private static class TrustManager implements X509TrustManager {

      private boolean checkServerValidity;



      void method_400(boolean var1) {

         this.checkServerValidity = var1;
      }

      public void checkClientTrusted(X509Certificate[] var1, String var2) {}

      public void checkServerTrusted(X509Certificate[] var1, String var2) throws CertificateException {
         if(this.checkServerValidity) {
            for(int var3 = 0; var3 < var1.length; ++var3) {
               var1[var3].checkValidity();
            }
         }

      }

      public X509Certificate[] getAcceptedIssuers() {
         return TrustManagerUtils.EMPTY_X509CERTIFICATE_ARRAY;
      }
   }
}

の行のエラー

 TrustManagerUtils.TrustManager var10000 = new TrustManagerUtils.TrustManager;
  var10000.method_400(false);
  ACCEPT_ALL = var10000;
  var10000 = new TrustManagerUtils.TrustManager;
  var10000.method_400(true);

これは、私が作成した新しい一時クラスを返すことができず、終了時に値を戻すことができないことを示しています。メソッド _400 を使用するためにクラスを trustmanager から一時 var1000 にコールバックしたいのですが、パスできません。

4

1 に答える 1