Timothy Appnel > Authen-TypeKey-Sign-0.07 > Authen::TypeKey::Sign

Download:
Authen-TypeKey-Sign-0.07.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View Bugs
Report a bug
Module Version: 0.07   Source  

NAME ^

Authen::TypeKey::Sign - TypeKey authentication signature generation

SYNOPSIS ^

    use Authen::TypeKey::Sign;
    my $tk = Authen::TypeKey::Sign->new;
    $tk->token('typekey-token');
    $tk->key('./TYPEKEYS');
    my $user = { name=>'foo', nick=>'Dr. Foo', 
        email=>'drfoo@spectre.evilorg' };
    my $querystring = $tk->sign($user) or die $tk->errstr;

DESCRIPTION ^

Authen::TypeKey::Sign is an implementation of the TypeKey authentication signature process. For information on the TypeKey protocol and using TypeKey in other applications, see http://www.movabletype.org/docs/tk-apps.html.

USAGE ^

Authen::TypeKey::Sign->new

Create a new Authen::TypeKey::Sign object.

$tk->token([ $typekey_token ])

Get/set the TypeKey token used when creating the original sign-in link. This is required to successfully validate the signature in TypeKey 1.1 and higher, which includes the token in the plaintext.

This must be set before calling sign.

$tk->key( [$keyfile|\%key|$dsa_key_obj] )

Gets/sets the DSA key. If no parameter is passed it returns the key as a Crypt::DSA::Key object. With a parameter it also sets the key. The parameter may be one of the following:

$tk->sign(\%user|$param_object)

Generates a TypeKey signature and returns a HTTP query string on success that can be used in its response to a TypeKey-enabled client. The method takes a required parameter of either a HASH reference or an object that supports a param method such as CGI or Apache::Request. The following hash keys are recognized:

Elements for ts (timestamp) and token will be handled by the sign method. ts will be set to the current time (seconds since epoch). If using TypeKey Protocol version 1.1 or higher, token will be the value set using the token method.

If generation is unsuccessful, sign will return undef, and the error message can be found in $tk->errstr.

$tk->version([ $version ])

Get/set the version of the TypeKey protocol to use. The default version if 1.1.

$tk->hide_email([0|1])

Get/set whether the TypeKey signature should "hide" the email address by encoding the value as a SHA-1 hash. Default is true (1).

SEE ALSO ^

http://www.movabletype.org/docs/tk-apps.html

http://www.typekey.com/

Authen::TypeKey, Apache::AuthTypeKey, typekeygen

DEPENDENCIES ^

Crypt::DSA Crypt::DSA::Key Crypt::DSA::Signature MIME::Base64 Getopt::Long 2.33+ Pod::Usage

LICENSE ^

The software is released under the Artistic License. The terms of the Artistic License are described at http://www.perl.com/language/misc/Artistic.html.

AUTHOR & COPYRIGHT ^

TypeKey is a trademark of Six Apart Ltd. TypeKey Authentication Protocol is Copyright 2004 Six Apart Ltd, cpan@sixapart.com. All rights reserved.

Except where otherwise noted, Authen::TypeKey::Sign is Copyright 2004, Timothy Appnel, cpan@timaoutloud.org. All rights reserved.