Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ To build the docker image run the following command on the root folder
```
docker build . -f docker/Dockerfile -t ltitool-python
```

### Key Generation

This project generates keys dynamically. If using Docker, this process happens at build time. If you are running locally without Docker, you will need to perform this step before you can run the application from the root level of the project:

```
python app/config/keys/build_config.py
```

This will generate private.key, public.key, and public.jwk.json.
8 changes: 6 additions & 2 deletions app/config/keys/build_config.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import json
import os
from jwcrypto.jwk import JWK
from Crypto.PublicKey import RSA

key_dir = "app/config/keys/"

def export_key(filename,key):
f = open(f"/app/app/config/keys/{filename}", "a")
f = open(f"{key_dir}{filename}", "a")
f.write(key)
f.close()


print(f"CWD: {os.getcwd()}")
key = RSA.generate(4096)
private_key = key.exportKey()
print(str(private_key))
Expand All @@ -16,7 +20,7 @@ def export_key(filename,key):
print(str(public_key))
export_key('public.key', str(public_key, encoding='UTF-8'))

f = open("/app/app/config/keys/public.key", "r")
f = open(f"{key_dir}public.key", "r")
public_pem = f.read()
f.close()

Expand Down
Empty file modified app/helpers/__init__.py
100644 → 100755
Empty file.
Empty file modified app/ims/__init__.py
100644 → 100755
Empty file.