Net::Amazon::AWSSign - Perl extension to create signatures for AWS requests


Net-Amazon-AWSSign documentation  | view source Contained in the Net-Amazon-AWSSign distribution.

Index


NAME

Top

Net::Amazon::AWSSign - Perl extension to create signatures for AWS requests

SYNOPSIS

Top

  use Net::Amazon::AWSSign;
  my $awsKey="AWS_Access_Key";  # Get this from AWS if you don't already have one
  my $awsSecret="AWS_Secret_Key";  # Get this from AWS if you don't already have one
  my $awsSign=new Net::Amazon::AWSSign("$awsKey", "$awsSecret");  # New object
  # SOAP
  my $awsSOAPAction=ItemSearch;
  my ($SOAPTimestamp, $SOAPSignature)=$awsSign->SOAPSig($awsSOAPAction);
  # REST
  my $awsASIN='B000002U82';   # Dark Side of the Moon
  my $awsRESTURI="http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&Operation=ItemLookup&ItemId=$awsASIN&ResponseGroup=Medium"; # Simple lookup
  my $awsSignedRESTURI=$awsSign->addRESTSecret($awsRESTURI);  # Returns signed REST query URI for lwp-get, curl, etc.

DESCRIPTION

Top

This module can be used to sign requests for most Amazon AWS services. While this is designed for simple lookups, it should work for pretty much any service (i.e. SDB, ELB), since the signing method is the same for all Amazon services. If you want to write your own program to use an Amazon API, this module might save you some time. Or, feel free to paste it into your own modules as long as you follow the license requirements.

As for available methods, the synopsis / example pretty much says it all. But, in the interest of full documentation...

METHODS

* new Net::Amazon::AWSSign("$AWS_Key", "$AWS_Secret")

Creates a new object. If you don't have a AWS key / secret you can register to get one free at http://aws.amazon.com/.

* SOAPSig($AWS_SOAP_Action)

Returns values for aws:Timestamp and aws:Signature to be included in your SOAP header. AWS recommends that you use certificate-based WS-Security instead of this method, but if you just need to do some quick and dirty one-time work it'll get the job done.

* addRESTSecret($Unsigned_URI)

Takes an unsigned REST URI as an argument and returns the signed URI. If the key is not already included in the URI, it will be automatically added before signing.

SEE ALSO

Top

Net::Amazon::Signature - if AWSSign doesn't meet your needs, then maybe this will.

AUTHOR

Top

Naton Aiman-Smith, <naton@cpan.org>

COPYRIGHT AND LICENSE

Top


Net-Amazon-AWSSign documentation  | view source Contained in the Net-Amazon-AWSSign distribution.