Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #68892 > unrolled thread

Re: TypeError in HMAC module.

Started byChris Angelico <rosuav@gmail.com>
First post2014-03-25 06:05 +1100
Last post2014-03-25 06:05 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: TypeError in HMAC module. Chris Angelico <rosuav@gmail.com> - 2014-03-25 06:05 +1100

#68892 — Re: TypeError in HMAC module.

FromChris Angelico <rosuav@gmail.com>
Date2014-03-25 06:05 +1100
SubjectRe: TypeError in HMAC module.
Message-ID<mailman.8456.1395687963.18130.python-list@python.org>
On Tue, Mar 25, 2014 at 2:15 AM, Prabir Kr Sarkar
<prabir.kr.sarkar@gmail.com> wrote:
> Hi,
>    I am trying to create a hashed message for authentication for a REST API
> call. I have got the key from a keyring as :-
>
> key = keyring.get_password('AWS_keyring','username')
>
> & calculating the signature as :-
> signature = hmac(key, message.encode('UTF-8'),
> hashlib.sha1).digest().encode('base64')[:-1]

I can't "import keyring", so either that's a module that isn't in the
Python standard library, or "keyring" is some object you've
instantiated. My crystal ball says this might be something to do with
Amazon Web Services, but it's hard to be sure. Can you please help us
out here by telling us all the dependencies of your code, and also
showing us a complete runnable program?

http://www.sscce.org/

Thanks!

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web