abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, new Base64(76, new byte[]{'\n'}).encodeToString(x509Certificates[0].getEncoded()));
} else {
try {
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509", "BC");
List<X509Certificate> certificates = Arrays.asList(x509Certificates);
abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, new Base64(76, new byte[]{'\n'}).encodeToString(certificateFactory.generateCertPath(certificates).getEncoded()));
} catch (CertificateException e) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
} catch (NoSuchProviderException e) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
}