No commit activity in last 3 years
No release in over 3 years
Here is a simple module for generating correctly signed tickets for use with the mod_auth_pubtkt Apache module, pretty basic stuff but usefully abstracts the OpenSSL complications.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

mod_auth_pubtkt.rb

Here is a simple module for generating correctly signed tickets for use with the mod_auth_pubtkt Apache module, pretty basic stuff but usefully abstracts the OpenSSL complications.

For more info on mod_auth_pubtkt see: https://neon1.net/mod_auth_pubtkt

Install

sudo gem install mod-auth-pubtkt-rb

Usage

Generate a public / private key pair

Taken from: https://neon1.net/mod_auth_pubtkt/install.html

DSA

# openssl dsaparam -out dsaparam.pem 1024
# openssl gendsa -out privkey.pem dsaparam.pem
# openssl dsa -in privkey.pem -out pubkey.pem -pubout

The dsaparam.pem file is not needed anymore after key generation and can safely be deleted.

RSA

# openssl genrsa -out privkey.pem 1024
# openssl rsa -in privkey.pem -out pubkey.pem -pubout

Use it in your code

require 'mod_auth_pubtkt'

# This will generate the ticket, see ./lib/mod_auth_pubtkt for available options
tkt = ModAuthPubTkt.create_ticket 12345, Time.now + 3600, "/my/privkey.pem", "DSA"

# Now you can use the ticket as a cookie value in your web app!

License

(GPLv3)

Copyright (C) 2010 Matt Haynes

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <www.gnu.org/licenses/>