Web::MicroID - An implementation of the MicroID standard


Web-MicroID documentation  | view source Contained in the Web-MicroID distribution.

Index


NAME

Top

Web::MicroID - An implementation of the MicroID standard

VERSION

Top

This documentation refers to Web::MicroID version 0.02

SYNOPSIS

Top

    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

Top

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

EXPORT

Top

None by default.

SEE ALSO

Top

http://microid.org/

METHODS

Top

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

Top

Digest::SHA1 Digest::MD5

BUGS AND LIMITATIONS

Top

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

Patches are welcome.

AUTHOR

Top

Jim Walker, <jim@reclaw.com>

COPYRIGHT AND LICENSE

Top


Web-MicroID documentation  | view source Contained in the Web-MicroID distribution.