Collection selfSignedTAsCerts = trustedSeparated[2];
String certProvider = (param.getCertProvider() != null) ? param
.getCertProvider() : param.getProvider();
CertPathBuilderResult bldResult = buildCertPath(certProvider, newCert,
selfSignedTAs, trustedCerts);
// The validation of the certificate path.
// According to black-box testing, RI keytool doesn't perform
// the certificate path validation procedure. Therefore this
// implementation also doesn't validate the certificate chain
// The path validation procedure can be done in future as an
// extension of the current functionality.
// The imported certificate should be included in the chain;
// The root CA is not included in it.
X509Certificate[] newChainNoCA = (X509Certificate[]) bldResult
.getCertPath().getCertificates()
.toArray(new X509Certificate[0]);
// get the subject of the root CA which will be the last element of the
// chain