TokenGenerator class

This class creates and validates tokens that allow the GridShibCA to verify the user is intending to use the GridShibCA and not being redirected here by, e.g., malicous JavaScript

Configuration Parameters

This class uses the following values from gridshib-ca.conf:

TokenKeyFile
Path to symetric key used to generate and validate tokens.

OpenSSL
Path to openssl binary to use

Methods

new()
Create a new Token object. Note this is not a token itself, just an instantiation of a Token object which can be used to create a token via the generate() method.

Arguments:

$userId - Id of user

$remoteHost - host from which user is connecting

Returns: Token instance

generate()
Create a token

Arguments: None

Returns: Token as string, undef on error

verify()
Verify and validate a token

Arguments:

$encTokenString - token as string

Returns: 1 on success, 0 otherwise

getError()
Return Error message from the command

Arguments: None

Returns: String containing Error Message from command. May be undef if no error has occurred.

Internal methods

These internal methods not intended for external use.

_error()
Handle a error message.

Arguments: As to sprintf()

Returns: Nothing

Version

GridShib-CA version 0.4.0 ($Id: TokenGenerator.pm.in,v 1.6 2007/03/17 04:31:42 welch Exp $)