code: private CodeSigner[] getSigners(SignerInfo infos[], PKCS7 block)
          throws IOException, NoSuchAlgorithmException, SignatureException,
              CertificateException {
  
          ArrayList<CodeSigner> signers = null;
  
          for (int i = 0; i < infos.length; i++) {
  
              SignerInfo info = infos[i];
              ArrayList<X509Certificate> chain = info.getCertificateChain(block);
              CertPath certChain = certificateFactory.generateCertPath(chain);
              if (signers == null) {
                  signers = new ArrayList<CodeSigner>();
              }
              // Append the new code signer
              signers.add(new CodeSigner(certChain, getTimestamp(info)));
  
              if (debug != null) {
                  debug.println("Signature Block Certificate: " +
                      chain.get(0));
              }
          }
  
          if (signers != null) {
              return signers.toArray(new CodeSigner[signers.size()]);
          } else {
              return null;
          }
      }
docs: Given the PKCS7 block and SignerInfo[], create an array of
  CodeSigner objects. We do this only *once* for a given
  signature block file.