jdk/src/share/classes/java/security/CodeSource.java
changeset 7970 af1579474d16
parent 5506 202f599c92aa
child 8784 29a6801dcf6f
equal deleted inserted replaced
7969:1a6282ab0d2a 7970:af1579474d16
   186             return certs.clone();
   186             return certs.clone();
   187 
   187 
   188         } else if (signers != null) {
   188         } else if (signers != null) {
   189             // Convert the code signers to certs
   189             // Convert the code signers to certs
   190             ArrayList<java.security.cert.Certificate> certChains =
   190             ArrayList<java.security.cert.Certificate> certChains =
   191                         new ArrayList<java.security.cert.Certificate>();
   191                         new ArrayList<>();
   192             for (int i = 0; i < signers.length; i++) {
   192             for (int i = 0; i < signers.length; i++) {
   193                 certChains.addAll(
   193                 certChains.addAll(
   194                     signers[i].getSignerCertPath().getCertificates());
   194                     signers[i].getSignerCertPath().getCertificates());
   195             }
   195             }
   196             certs = certChains.toArray(
   196             certs = certChains.toArray(
   604                 factory = CertificateFactory.getInstance("X.509");
   604                 factory = CertificateFactory.getInstance("X.509");
   605             }
   605             }
   606 
   606 
   607             // Iterate through all the certificates
   607             // Iterate through all the certificates
   608             int i = 0;
   608             int i = 0;
   609             List<CodeSigner> signers = new ArrayList<CodeSigner>();
   609             List<CodeSigner> signers = new ArrayList<>();
   610             while (i < certs.length) {
   610             while (i < certs.length) {
   611                 List<java.security.cert.Certificate> certChain =
   611                 List<java.security.cert.Certificate> certChain =
   612                         new ArrayList<java.security.cert.Certificate>();
   612                         new ArrayList<>();
   613                 certChain.add(certs[i++]); // first cert is an end-entity cert
   613                 certChain.add(certs[i++]); // first cert is an end-entity cert
   614                 int j = i;
   614                 int j = i;
   615 
   615 
   616                 // Extract chain of certificates
   616                 // Extract chain of certificates
   617                 // (loop while certs are not end-entity certs)
   617                 // (loop while certs are not end-entity certs)