hmac-signature

command module
v0.0.0-...-a7f809b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2015 License: MIT Imports: 10 Imported by: 0

README

hmac-signature

HMAC Signature example

Configuring go

Install go runtime. On Mac type:

brew install go

On Ubuntu/Debian type:

sudo apt-get install golang

Set the $GOPATH:

export GOPATH=~/GO
mkdir -p $GOPATH
export PATH=$GOPATH/bin:$PATH

Installation

Using go get
go get github.com/dcu/hmac-signature
Using git clone
git clone https://github.com/dcu/hmac-signature
cd hmac-signature
go build hmac-signature.go

Usage

hmac-signature -key="<a key>" -url="<url>" -nonce="<optional nonce>" -params="<param list>"

For example:

$ hmac-signature -key="key" -url="example.com/path" -nonce="123" -params="c=3 b=2 a=1"
URL: example.com/path
Params: a=1&b=2&c=3
Nonce: 123
Data: 123example.com/patha=1&b=2&c=3

Signature: R3DT7W9IGZjiRAip9LJTLbEzX981JZfZpd7/gmt8BNU=
Nonce: 123

if the nonce is not provided, one is generated automatically:

$ hmac-signature -key="key" -url="example.com/path" -params="c=3 b=2 a=1"
URL: example.com/path
Params: a=1&b=2&c=3
Nonce: 1427897981316727363
Data: 1427897981316727363example.com/patha=1&b=2&c=3

Signature: GiegYK7oTBjSDSzo7/wZ2V0BHasXj313/4N4FV+DsLI=
Nonce: 1427897981316727363

Algorithm

You can follow the code and comments here

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL