-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cd524d7
commit 9b7ce63
Showing
3 changed files
with
45 additions
and
27 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
# Email server | ||
|
||
Add an email address for use in your [IRMA app](https://github.com/privacybydesign/irma_mobile). | ||
|
||
|
||
## Setting up the server | ||
|
||
1. Generate JWT keys for the issuer | ||
```bash | ||
./utils/keygen.sh ./src/main/resources/sk ./src/main/resources/pk | ||
``` | ||
2. Copy the file `src/main/resources/config.sample.json` to | ||
`build/resources/main/config.json` and modify it. | ||
3. Run `gradle appRun` in the root directory of this project. | ||
4. Navigate to `http://localhost:8080/irma_email_issuer/api/hello` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,34 @@ | ||
#!/bin/bash | ||
|
||
dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) | ||
# Check if openssl exists | ||
if ! type openssl >/dev/null 2>&1; then | ||
>&2 echo "openssl not found, exiting" | ||
exit 1 | ||
fi | ||
|
||
SK=$dir/../build/resources/main/sk | ||
PK=$dir/../build/resources/main/pk | ||
if [[ $# -eq 0 ]]; then | ||
SK=sk | ||
PK=pk | ||
fi | ||
if [[ $# -eq 1 ]]; then | ||
>&2 echo "Either supply 0 or 2 arguments" | ||
exit 1 | ||
fi | ||
if [[ $# -eq 2 ]]; then | ||
SK=$1 | ||
PK=$2 | ||
fi | ||
|
||
if [ ! -e "$SK" ]; then | ||
# Generate a private key in PEM format | ||
openssl genrsa -out ${SK}.pem 2048 | ||
# Convert it to DER for Java | ||
openssl pkcs8 -topk8 -inform PEM -outform DER -in ${SK}.pem -out ${SK}.der -nocrypt | ||
# Calculate corresponding public key, saved in PEM format | ||
openssl rsa -in ${SK}.pem -pubout -outform PEM -out ${PK}.pem | ||
# Calculate corresponding public key, saved in DER format | ||
openssl rsa -in ${SK}.pem -pubout -outform DER -out ${PK}.der | ||
# Remove leftover files | ||
if [ -e ${SK}.der ] || [ -e ${PK}.der ]; then | ||
echo "Keys already exist, not generating new ones" | ||
exit | ||
fi | ||
rm -f ${SK}.pem | ||
rm -f ${PK}.pem | ||
|
||
# Generate a private key in PEM format | ||
openssl genrsa -out ${SK}.pem 2048 | ||
# Convert it to DER for Java | ||
openssl pkcs8 -topk8 -inform PEM -outform DER -in ${SK}.pem -out ${SK}.der -nocrypt | ||
# Calculate corresponding public key, saved in PEM format | ||
openssl rsa -in ${SK}.pem -pubout -outform PEM -out ${PK}.pem | ||
# Calculate corresponding public key, saved in DER format | ||
openssl rsa -in ${SK}.pem -pubout -outform DER -out ${PK}.der |