TypeError in HMAC module.

Chris Angelico rosuav at gmail.com
Mon Mar 24 15:05:55 EDT 2014


On Tue, Mar 25, 2014 at 2:15 AM, Prabir Kr Sarkar
<prabir.kr.sarkar at 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



More information about the Python-list mailing list