package mapped;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.util.LinkedList;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import org.bouncycastle.crypto.tls.Certificate;
import org.bouncycastle.crypto.tls.CertificateRequest;
import org.bouncycastle.crypto.tls.TlsAuthentication;
import org.bouncycastle.crypto.tls.TlsCredentials;

@ObfuscatedName("av")
class class11 implements TlsAuthentication {
   @ObfuscatedName("ac")
   @ObfuscatedSignature(
      descriptor = "Lup;"
   )
   static IndexedSprite field47;
   @ObfuscatedName("kv")
   @ObfuscatedSignature(
      descriptor = "Luz;"
   )
   static SpritePixels redHintArrowSprite;
   // $FF: synthetic field
   @ObfuscatedSignature(
      descriptor = "Las;"
   )
   final class13 this$2;

   @ObfuscatedSignature(
      descriptor = "(Las;)V"
   )
   class11(class13 var1) {
      this.this$2 = var1;
   }

   public void notifyServerCertificate(Certificate var1) throws IOException {
      try {
         CertificateFactory var2 = CertificateFactory.getInstance("X.509");
         LinkedList var3 = new LinkedList();
         org.bouncycastle.asn1.x509.Certificate[] var4 = var1.getCertificateList();

         for(int var5 = 0; var5 < var4.length; ++var5) {
            org.bouncycastle.asn1.x509.Certificate var6 = var4[var5];
            var3.add(var2.generateCertificate(new ByteArrayInputStream(var6.getEncoded())));
         }

         this.this$2.this$1.field52 = (java.security.cert.Certificate[])((java.security.cert.Certificate[])var3.toArray(new java.security.cert.Certificate[0]));
      } catch (CertificateException var7) {
         throw new IOException(var7);
      }
   }

   public TlsCredentials getClientCredentials(CertificateRequest var1) throws IOException {
      return null;
   }

   @ObfuscatedName("nv")
   @ObfuscatedSignature(
      descriptor = "(Lnn;B)Z",
      garbageValue = "-26"
   )
   static boolean method114(Widget var0) {
      return var0.isHidden;
   }
}
