The following command has been used to generate test keys:

  for x in 256 512 1024; do openssl genrsa -out rsa${k}_key.pem $k; done

and for the CSR:

  python -c from 'letsencrypt.crypto_util import make_csr;
  import pkg_resources; open("csr2.pem",
  "w").write(make_csr(pkg_resources.resource_string("letsencrypt.tests",
  "testdata/rsa512_key.pem"), ["example2.com"])[0])'
