The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Apache::Wyrd::Services::Key - Apache-resident crypto key (Blowfish)

SYNOPSIS

        <Perl>
                use strict;
                use Apache::Wyrd::Services::Key;
                Apache::Wyrd::Services::Key->instance();
        </Perl>

DESCRIPTION

A subclass of the Singleton class, the key is created using the instance method, not the new method.

Generates a random cryptographic key (for Blowfish) for use with an Apache::Wyrd::Services::CodeRing object. Designed to be used at server startup in order to keep the key in shared memory. As the key is never stored in a file and then changes on server restart, it cannot be obtained trivially. This makes it suitable for storing state information on the browser without exposing the internals of your program.

If Blowfish is not available on your system, it will attempt Blowfish_PP (pure perl) before failing to compile.

Fixed keys are also possible. The instance method can also accept a string as an argument to use in place of a randomly-generated key.

In development environments, with frequent server restarts, it is advisable to use a fixed key to prevent your Form state and Login Cookies from becoming unusable.

METHODS

(format: (returns) name (arguments after self))

(void) instance ([scalar])

Initialize the Key object. If an optional key is supplied, the cypher is initialized with that key. If not, a random key is generated.

(void) key ([scalar])

Return the key.

(void) cypher ([scalar])

Return the cypher, which will be a Crypt::Blowfish/_PP object.

BUGS/CAVEATS/RESERVED METHODS

Unless a fixed key is used, any encrypted information is irretrievable on server restart.

AUTHOR

Barry King <wyrd@nospam.wyrdwright.com>

SEE ALSO

Apache::Wyrd

General-purpose HTML-embeddable perl object

Apache::Wyrd::Services::CodeRing

General-purpose HTML-embeddable perl object

Apache::Wyrd::Services::Auth

General-purpose HTML-embeddable perl object

LICENSE

Copyright 2002-2007 Wyrdwright, Inc. and licensed under the GNU GPL.

See LICENSE under the documentation for Apache::Wyrd.