FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
code-examples-python/connect_test.py at master · bionicstorkdemo/code-examples-python · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
bionicstorkdemo
/
code-examples-python
Public
forked from
docusign/code-examples-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
code-examples-python
/
connect_test.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
14 lines (12 loc) · 622 Bytes
Breadcrumbs
code-examples-python
/
connect_test.py
Copy path
File metadata and controls
14 lines (12 loc) · 622 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def
validateHMAC
():
import
hmac
import
hashlib
import
base64
file
=
open
(
"payload.txt"
,
"rb"
)
# Read the payload from a file named payload.txt
payload
=
file
.
read
()
secret
=
"4+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxuE="
# Replace this value with your own secret
signature
=
"e4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxhg="
# Replace this value with your own signature
hashBytes
=
hmac
.
new
(
str
.
encode
(
secret
),
msg
=
payload
,
digestmod
=
hashlib
.
sha256
).
digest
()
base64Hash
=
base64
.
b64encode
(
hashBytes
)
return
hmac
.
compare_digest
(
str
.
encode
(
signature
),
base64Hash
)
print
(
validateHMAC
())
Back
|
FazBrowse Home
|
New Git URL