diff --git a/hello_world/app.py b/hello_world/app.py index b6603bf..fabd78d 100644 --- a/hello_world/app.py +++ b/hello_world/app.py @@ -1,10 +1,28 @@ import json -from pki_tools import Name, Certificate, LoadError +import datetime + +from pki_tools import Name, Certificate, Validity, RSAKeyPair, SHA512 def lambda_handler(event, context): - print(pki_tools.__version__) + name = Name(cn=["Cert CN"]) + + validity = Validity( + not_before=datetime.datetime.today() - datetime.timedelta(days=1), + not_after=datetime.datetime.today() + datetime.timedelta(days=1), + ) + + cert = Certificate( + subject=name, + issuer=name, + validity=validity, + ) + + cert.sign(RSAKeyPair.generate(), SHA512) + + print(cert) + # try: # ip = requests.get("http://checkip.amazonaws.com/")