Program: 49604
Project: 49604
Buggy source:
/** 
 * we generate a certificate signed by our CA's intermediate certficate
 * @param name Name on certificate
 * @param email on certificate
 * @param pubKey public key
 * @param caPrivKey ca private key
 * @param caPubKey ca public key
 * @throws Exception thrown in the event of an error.
 * @return X.509 Certificate
 */
public static X509Certificate createClientCert(String name,String email,PublicKey pubKey,PrivateKey caPrivKey,PublicKey caPubKey) throws Exception {
  String issuer="String_Node_Str";
  Hashtable<DERObjectIdentifier,Object> attrs=new Hashtable<DERObjectIdentifier,Object>();
  Vector<DERObjectIdentifier> order=new Vector<DERObjectIdentifier>();
  attrs.put(X509Principal.C,"String_Node_Str");
  attrs.put(X509Principal.O,"String_Node_Str");
  attrs.put(X509Principal.L,"String_Node_Str");
  attrs.put(X509Principal.CN,name);
  attrs.put(X509Principal.EmailAddress,email);
  order.addElement(X509Principal.C);
  order.addElement(X509Principal.O);
  order.addElement(X509Principal.L);
  order.addElement(X509Principal.CN);
  order.addElement(X509Principal.EmailAddress);
  v3CertGen.reset();
  v3CertGen.setSerialNumber(BigInteger.valueOf(20));
  v3CertGen.setIssuerDN(new X509Principal(issuer));
  v3CertGen.setNotBefore(new Date(System.currentTimeMillis() - 1000L * 60 * 60* 24* 30));
  v3CertGen.setNotAfter(new Date(System.currentTimeMillis() + (1000L * 60 * 60* 24* 30)));
  v3CertGen.setSubjectDN(new X509Principal(order,attrs));
  v3CertGen.setPublicKey(pubKey);
  v3CertGen.setSignatureAlgorithm("String_Node_Str");
  new NetscapeCertType(NetscapeCertType.PRINTABLE_STRING);
  GeneralNames altnames=new GeneralNames(new GeneralName(GeneralName.rfc822Name,"String_Node_Str"));
  v3CertGen.addExtension(X509Extensions.SubjectAlternativeName,false,altnames);
  X509Certificate cert=v3CertGen.generate(caPrivKey);
  cert.checkValidity(new Date());
  cert.verify(caPubKey);
  return cert;
}

Fixed version (ground truth):
/** 
 * we generate a certificate signed by our CA's intermediate certficate
 * @param name Name on certificate
 * @param email on certificate
 * @param pubKey public key
 * @param caPrivKey ca private key
 * @param caPubKey ca public key
 * @throws Exception thrown in the event of an error.
 * @return X.509 Certificate
 */
public static X509Certificate createClientCert(String name,String email,PublicKey pubKey,PrivateKey caPrivKey,PublicKey caPubKey) throws Exception {
  String issuer="String_Node_Str" + "String_Node_Str";
  Hashtable<DERObjectIdentifier,Object> attrs=new Hashtable<DERObjectIdentifier,Object>();
  Vector<DERObjectIdentifier> order=new Vector<DERObjectIdentifier>();
  attrs.put(X509Principal.C,"String_Node_Str");
  attrs.put(X509Principal.O,"String_Node_Str");
  attrs.put(X509Principal.L,"String_Node_Str");
  attrs.put(X509Principal.CN,name);
  attrs.put(X509Principal.EmailAddress,email);
  order.addElement(X509Principal.C);
  order.addElement(X509Principal.O);
  order.addElement(X509Principal.L);
  order.addElement(X509Principal.CN);
  order.addElement(X509Principal.EmailAddress);
  v3CertGen.reset();
  v3CertGen.setSerialNumber(BigInteger.valueOf(20));
  v3CertGen.setIssuerDN(new X509Principal(issuer));
  v3CertGen.setNotBefore(new Date(System.currentTimeMillis() - 1000L * 60 * 60* 24* 30));
  v3CertGen.setNotAfter(new Date(System.currentTimeMillis() + (1000L * 60 * 60* 24* 30)));
  v3CertGen.setSubjectDN(new X509Principal(order,attrs));
  v3CertGen.setPublicKey(pubKey);
  v3CertGen.setSignatureAlgorithm("String_Node_Str");
  new NetscapeCertType(NetscapeCertType.PRINTABLE_STRING);
  GeneralNames altnames=new GeneralNames(new GeneralName(GeneralName.rfc822Name,"String_Node_Str"));
  v3CertGen.addExtension(X509Extensions.SubjectAlternativeName,false,altnames);
  X509Certificate cert=v3CertGen.generate(caPrivKey);
  cert.checkValidity(new Date());
  cert.verify(caPubKey);
  return cert;
}