HTTP Signature perl6 implementation
Perl6
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/HTTP
t
.travis.yml
META.info
README.md

README.md

Perl6-HTTP-Signature

Build Status

SYNOPSIS

ALPHA Implementation of http signature as defined in IETFF draft version 3

Heavily inspired from Authen::HTTP::Signature on perl5

To sign a request:

use HTTP::Signature;
use HTTP::UserAgent;
use HTTP::Request;

my $req = HTTP::Request.new(
    :GET('http://www.example.com/path')
);

my $signer = HTTP::Signature.new(
    keyid       => 'Test',
    secret      => 'MySuperSecretKey',
    algorithm   => 'hmac-sha256',
);
my $signed-request = $signer->sign-request( $req );
my $ua = HTTP::UserAgent.new;
my $response = $ua.request( $signed-request );

To verify a request:

use HTTP::Signature;

my $signer = HTTP::Signature.new(
    secret      => 'MySuperSecretKey',
);
if $signer.verify-request( $req ) {
    ...
}

DESCRIPTION