Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewbigin committed Mar 1, 2020
1 parent 4813654 commit 55eeb43
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
30 changes: 17 additions & 13 deletions ec2_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@
import json
from pprint import pprint


def main():
print("Verifying ec2 instance identity document")
print("Verifying ec2 instance identity document")

r = requests.get("http://169.254.169.254/latest/dynamic/instance-identity/document")
identity_document = r.text

r = requests.get('http://169.254.169.254/latest/dynamic/instance-identity/document')
identity_document = r.text
r = requests.get("http://169.254.169.254/latest/dynamic/instance-identity/pkcs7")
pkcs7 = r.text

r = requests.get('http://169.254.169.254/latest/dynamic/instance-identity/pkcs7')
pkcs7 = r.text
if verify_detached_signature(
identity_document, pkcs7, aws_certificates.PUBLIC_REGIONS
):
print("Verified")
identity = json.loads(identity_document)
pprint(identity)
else:
print("Identity is not valid")

if(verify_detached_signature(identity_document, pkcs7, aws_certificates.PUBLIC_REGIONS)):
print("Verified")
identity = json.loads(identity_document)
pprint(identity)
else:
print("Identity is not valid")

if __name__ == '__main__':
main()
if __name__ == "__main__":
main()
1 change: 0 additions & 1 deletion pkcs7_detached/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
Base on the steps in https://github.com/openssl/openssl/blob/master/apps/smime.c
certificate is a PEM formated X509 certificate
"""


Expand Down

0 comments on commit 55eeb43

Please sign in to comment.