public Certificate buildCertificate(String certString) throws InvalidCertificate {
  try {
    String base64Cert=formatCertificate(certString);
    InputStream inBytes=new ByteArrayInputStream(base64Cert.getBytes());
    CertificateFactory cf=CertificateFactory.getInstance("X.509");
    assert inBytes.available() > 0;
    Certificate certificate=cf.generateCertificate(inBytes);
    inBytes.close();
    return certificate;
  }
 catch (  Exception e) {
    log.debug("buildCertificate: error " + e + " converted to InvalidCertificate.");
    throw FaultUtil.InvalidCertificate("Could not build certificate");
  }
}

public Certificate buildCertificate ( String certString ) throws InvalidCertificate { try { String base64Cert = formatCertificate ( certString ) ; InputStream inBytes = new ByteArrayInputStream ( base64Cert . getBytes ( ) ) ; CertificateFactory cf = CertificateFactory . getInstance ( "X.509" ) ; assert inBytes . available ( ) > 0 ; Certificate certificate = cf . generateCertificate ( inBytes ) ; inBytes . close ( ) ; return certificate ; } catch ( Exception e ) { log . debug ( "buildCertificate: error " + e + " converted to InvalidCertificate." ) ; throw FaultUtil . InvalidCertificate ( "Could not build certificate" ) ; } }
buildcertificate build a certificate from a base64 formatted , pkcs # 7 encoding of the certificate
