diff options
author | Adam Kocoloski <adam@cloudant.com> | 2010-08-11 15:34:41 -0400 |
---|---|---|
committer | Adam Kocoloski <adam@cloudant.com> | 2010-08-11 17:39:37 -0400 |
commit | 8138d70bb8c1de954c46b417ccd22964b6432965 (patch) | |
tree | f833623bbf690a3d4d5799b6492e1ac729bfc152 /apps/oauth/src/oauth_hmac_sha1.erl | |
parent | 1c9d5c118ace092e228f60359e2863da1d3b1bc7 (diff) |
move oauth to rebar layout
Diffstat (limited to 'apps/oauth/src/oauth_hmac_sha1.erl')
-rw-r--r-- | apps/oauth/src/oauth_hmac_sha1.erl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/oauth/src/oauth_hmac_sha1.erl b/apps/oauth/src/oauth_hmac_sha1.erl new file mode 100644 index 00000000..79d59f37 --- /dev/null +++ b/apps/oauth/src/oauth_hmac_sha1.erl @@ -0,0 +1,11 @@ +-module(oauth_hmac_sha1). + +-export([signature/3, verify/4]). + + +signature(BaseString, CS, TS) -> + Key = oauth_uri:calate("&", [CS, TS]), + base64:encode_to_string(crypto:sha_mac(Key, BaseString)). + +verify(Signature, BaseString, CS, TS) -> + couch_util:verify(signature(BaseString, CS, TS), Signature). |