code: public byte[] createCertificateRequest(String subject, KeyPair keyPair) throws GeneralSecurityException {
          X509Name name = new X509Name(subject);
          return createCertificateRequest(name, "MD5WithRSAEncryption", keyPair);
      }
docs: Creates a certificate request from the specified subject DN and a key pair. The
  <I>"MD5WithRSAEncryption"</I> is used as the signing algorithm of the certificate request.
  
  @param subject
  the subject of the certificate request
  @param keyPair
  the key pair of the certificate request
  @return the certificate request.
  @exception GeneralSecurityException
  if security error occurs.