Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Support for netscape / html5 SPKAC client certificate request
Python
Tag: V-0.2

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
pyspkac
.gitignore
MANIFEST.in
README.rst
setup.py

README.rst

pyspkac: Routines for supporting netscape / html5 SPKAC

Author: Ralf Schlatterbeck <rsc@runtux.com>

This library supports the format of browser-generated SPKAC certificate requests.

The HTML keygen tag which previously was supported by most Mozilla-based browsers is now in the HTML-5 standard. The keygen tag is used in a HTML form element and displays a key generation widget to the user. When submitted, the browser locally generates a public key pair, locally stores the private key, and submits the public key to the web server in the SPKAC format.

When generating a form with a keygen element, the web server can include a challenge string in the form. This challenge string is returned in the SPKAC generated by the browser. It is signed together with the public key by the private key retained by the browser.

This package is intended for server-side support of SPKAC. It uses a submitted SPKAC and checks for correct challenge string and that the public key and challenge are properly signed by the browser. It supports a method for generating a certificate from the data in the SPKAC and additional data supplied by the web application.

The generated certificate can then typically be used for client authentication to a web application and is therefore called a client certificate. The web browser (or other client-side application) supplies the certificate in the SSL handshake and proves it is in the posession of the necessary private key.

Installation

Install using the standard python setup.py mechanism, e.g.:

python setup.py install --prefix=/usr/local

You need pyasn1 and M2Crypto installed for this package to work.

Examples

For a usage example see the doctests in spkac.py

Changes

Version 0.2: Minor feature additions

Move example from end of spkac.py into a doctest. Change of API: set_email no longer supported. Now extensions can be given as unnamed arguments in the constructor. Named arguments are interpreted as subject parameters for the resulting certificate. All this is shown in the doctest.

  • Remove set_email
  • Change constructor: Allow extensions as args and subject parameters as keyword args
  • Add doctest
  • Fix setup.py to include install_requires to auto-install required packages
  • Easier import: from pyspkac import SPKAC works now.

Version 0.1: Initial Release

Something went wrong with that request. Please try again.