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


Groups > comp.lang.python > #68892

Re: TypeError in HMAC module.

References <CADjSiz7y2Zx8RDtE5n8gRMQ=0A3mcB_s548R4FXkBO1cfA-vog@mail.gmail.com>
Date 2014-03-25 06:05 +1100
Subject Re: TypeError in HMAC module.
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.8456.1395687963.18130.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web