Crypt-OpenToken

 view release on metacpan or  search on metacpan

lib/Crypt/OpenToken.pm  view on Meta::CPAN

      $data = $token->data();
  }

=head1 DESCRIPTION

This module provides a Perl implementation of the "OpenToken" standard as
defined by Ping Identity in their IETF Draft.

=head1 METHODS

=over

=item Crypt::OpenToken->new(password => $password)

Instantiates a new OpenToken factory, which can encrypt/decrypt OpenTokens
using the specified shared C<$password>.

=item $factory->create($cipher, $data)

Encrypts the given hash-ref of C<$data> using the specified C<$cipher> (which
should be one of the C<CIPHER_*> constants).

Returns back to the caller a Base64 encoded string which represents the
OpenToken.

B<NOTE:> during the encryption of the OpenToken, a random Initialization
Vector will be selected; as such it is I<not> possible to encrypt the same
data more than once and get the same OpenToken back.

=item $factory->parse($token)

Decrypts a Base64 encoded OpenToken, returning a C<Crypt::OpenToken::Token>
object back to the caller.  Throws a fatal exception in the event of an error.

It is the callers responsibility to then check to see if the token itself is
valid (see L<Crypt::OpenToken::Token> for details).

=back

=head1 CONSTANTS

The following constant values are available for selecting an encryption cipher
to use:

=over

=item Crypt::OpenToken::CIPHER_NULL

"Null" encryption (e.g. no encryption whatsoever).  Requires C<Crypt::NULL>.

=item Crypt::OpenToken::CIPHER_AES256

"AES" encryption, 256-bit.  Requires C<Crypt::Rijndael>.

=item Crypt::OpenToken::CIPHER_AES128

"AES" encryption, 128-bit.  Requires C<Crypt::Rijndael>.

=item Crypt::OpenToken::CIPHER_DES3

"TripleDES" encryption, 168-bit.  Requires C<Crypt::DES>.

=back

=for Pod::Coverage CIPHERS TOKEN_PACK

=head1 CAVEATS

=over

=item *

This module does not (yet) support the "obfuscate password" option that is
configurable within PingFederate's OpenToken adapter.

=back

=head1 AUTHOR

Graham TerMarsch (cpan@howlingfrog.com)

Shawn Devlin (shawn.devlin@socialtext.com)

=head2 Contributors

Thanks to those who have provided feedback, comments, and patches:

  Jeremy Stashewsky
  Travis Spencer

=head2 Sponsors

B<BIG> thanks also go out to those who sponsored C<Crypt::OpenToken>:

=over

=item Socialtext

Thanks for sponsoring the initial development of C<Crypt::OpenToken>, and then
being willing to release it to the world.

=item Ping Identity

Thanks for your assistance during the initial development, providing feedback
along the way, and answering our questions as they arose.

=back

=head1 COPYRIGHT & LICENSE

=head2 Crypt::OpenToken

C<Crypt::OpenToken> is Copyright (C) 2010, Socialtext, and is released under
the Artistic-2.0 license.

=head2 OpenToken specification

The OpenToken specification is Copyright (C) 2007-2010 Ping Identity
Corporation, and released under the MIT License:

=over



( run in 0.759 second using v1.01-cache-2.11-cpan-39bf76dae61 )