code: private static java.security.cert.Certificate[] mapSignersToCertArray(
          CodeSigner[] signers) {
  
          if (signers != null) {
              ArrayList certChains = new ArrayList();
              for (int i = 0; i < signers.length; i++) {
                  certChains.addAll(
                      signers[i].getSignerCertPath().getCertificates());
              }
  
              // Convert into a Certificate[]
              return (java.security.cert.Certificate[])
                  certChains.toArray(
                      new java.security.cert.Certificate[certChains.size()]);
          }
          return null;
      }
docs: /*
  Convert an array of signers into an array of concatenated certificate
  arrays.