First working version that let you download pass on http request

Added config.json for paths and credentials configuration.
This commit is contained in:
Alexander Cerutti
2018-05-06 00:06:38 +02:00
parent 7164961ddb
commit 269e85e7f8
7 changed files with 649 additions and 49 deletions

25
certificates/pkcs12tokeys.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
# This script is just a shortcut to extract public and private keys from pkcs#12 key file
# For the ones who never used BASH, remember to not put spaces
# in variable=value or it won't work.
# This is the pass used on .p12 file exported from the keychain
passToExtract="alpaca2018"
# This is the secret to encrypt the key (second command) - use complex secret on production
secret="123456"
# This is the name of the .p12 file exported from the keychain.
# You can put also paths but remember the starting point is the "certificates/" folder
# Example : the file is on the parent folder
# baseFile="../pass-exported.p12"
baseFile="passCertificate-exported.p12"
cd "$(dirname "$0")"
# Certificate Key in .pem format
sudo openssl pkcs12 -in ${baseFile} -clcerts -nokeys -out passcertificate.pem -passin pass:${passToExtract}
# Key in .pem format
sudo openssl pkcs12 -in ${baseFile} -nocerts -out passkey.pem -passin pass:$passToExtract -passout pass:${secret}