code: private Certificate[] getCertificates(String parsedCertificates, KeyStore keystore) throws Exception {
          String[] splitCertificates = new String[0];
          if (parsedCertificates != null) {
              splitCertificates = parsedCertificates.split(",");
          }
          if (splitCertificates.length > 0 && keystore == null) {
              throw new Exception("ER006: Keystore must be defined if signedBy is used");
          }
          List<Certificate> certList = new ArrayList<Certificate>();
          for (int i = 0; i < splitCertificates.length; i++) {
              Certificate certificate = keystore.getCertificate(splitCertificates[i]);
              if (certificate != null) {
                  certList.add(certificate);
              } else {
                  // return null to indicate that this permission is ignored
                  return null;
              }
          }
          Certificate[] certificates;
          if (certList.isEmpty()) {
              certificates = null;
          } else {
              certificates = new Certificate[certList.size()];
              certList.toArray(certificates);
          }
          return certificates;
      }
docs: Private method for getting certificates from KeyStore.
  
  @param parsedCertificates signedBy part of policy file defines certificates
  @param keystore KeyStore which is used by this policy file
  @return array of Certificates
  @throws Exception when there was any problem during getting Certificates