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

NAME

Web::MicroID - An implementation of the MicroID standard

VERSION

This documentation refers to Web::MicroID version 0.02

SYNOPSIS

    use Web::MicroID;

    $id = Web::MicroID->new();

    $id->individual('mailto:user@domain.tld');
    $id->serv_prov('http://domain.tld/'); 
    # Generate a MicroID token
    $micro_id = $id->generate();
    # Process (validate) a MicroID token
    $test = $id->process($micro_id);

DESCRIPTION

This module is used to generate or process a MicroID token.

EXPORT

None by default.

SEE ALSO

http://microid.org/

METHODS

new()

The new() constructor doesn't require any arguments.

    $id = Web::MicroID->new();

You can optionally set the value of one or all these methods.

    $id = Web::MicroID->new(
        {
            algorithm  => $algorithm
            individual => $individual,
            serv_prov  => $serv_prov,
            process    => $process,
        }
    );
individual()

Will set or get the value for an individual's ID.

    $individual = 'mailto:user@domain.tld';
    $id->individual($individual);

or

    $individual = $id->individual();
indv_uri()

Will get the URI type of the individual's ID (e.g., 'mailto').

indv_val()

Will get the URI value for the individual's URI (e.g., 'user@domain.tld').

serv_prov()

Will set or get the value for the service provider's ID.

    $serv_prov = 'http://domain.tld/';
    $id->serv_prov($serv_prov);

or

    $serv_prov = $id->serv_prov();
serv_prov_uri()

Will get the URI type for the service provider's ID (e.g., 'http').

serv_prov_val()

Will get the URI value of the service provider's ID (e.g., 'domain.tld').

algorithm()

Will set or get the algorithm method. Either (md5 or sha1), defaults to 'sha1'.

    $algorithm = 'md5';
    $id->algorithm($algorithm);

or

    $algorithm = $id->algorithm();
generate()

Generate a MicroID token

    $micro_id = $id->generate();
legacy()

Well get the hash portion of the MicroID token.

    $legacy = id->legacy();
process()

Sets and processes (validates) a MicroID token. Works with both conforming and legacy MicroID specs. Returns true if successful, undefined on failure.

    $test = $id->process(
        'mailto+http:sha1:7964877442b3dd0b5b7487eabe264aa7d31f463c';
    );

or

    $test = $id->process();

DEPENDENCIES

Digest::SHA1 Digest::MD5

BUGS AND LIMITATIONS

There are no known bugs in this module. Please report problems to the author.

Patches are welcome.

AUTHOR

Jim Walker, <jim@reclaw.com>

COPYRIGHT AND LICENSE

Copyright (c) 2007 Jim Walker, <jim@reclaw.com> All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

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.