[pyOpenSSL] Creating certificates

Remy C. Cool dev-python at smartology.nl
Wed Mar 10 08:33:38 CET 2004


On Wednesday 10 March 2004 08:11, Remy C. Cool wrote:
> On Tuesday 09 March 2004 19:56, Remy C. Cool wrote:
> > Hello,
> >
> > Two short questions:
> >
> > According to the doc string in createCertRequest (certgen.py) it
> > must be possible to enter SP and email arguments, but both fail
> > in my test code. I used mk_simple_certs.py as a base changing the
> > line:
> >
> > careq = createCertRequest(cakey, CN='Certificate Authority')
> > into
> > careq = createCertRequest(cakey, CN='Certificate Authority',
> > SP='State', email='me at here.net')
> >
> > Any solutions?
>
> Found'em
>
> When you use 'ST' instead of 'SP' and 'emailAddress' instead of
> 'email' the certificates are generated without any problems.
> Is this a bug in the doc-string or something system dependent?
>
> So, if anyone knows the answer to the second question ... please
> let me know.
>
> > And I would like to know if it's possible to create a (CA)
> > certificate with a passphrase/password using pyOpenSSL?

Hmm, reading the source and manuals - again - did help (duh).

Writing the key to ie. disk:
crypto.dump_privatekey(type, pkey[, cipher, passphrase])

Reading the key from ie. disk:
crypto.load_privatekey(type, buffer[, passphrase])






More information about the pyopenssl-users mailing list