DEB packaging of Comarch Crypto Provider from ePUAP
Jacek Kowalski
2017-07-12 11f0bfe0b2c55127c8914e8a15f8c7d879a9ccdb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
 
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
 
    INSTALLDIR="/usr/local/ComarchCryptoProvider"
    
    echo "Generating self-signed certificate for localhost..."
    openssl genrsa -out ${INSTALLDIR}/certs/CCP-key-server.pem
    openssl req -x509 -sha256 -days 1000   \
        -config "${INSTALLDIR}/openssl.cnf" \
        -subj "/CN=localhost/O=ComarchCryptoProvider" \
        -key "${INSTALLDIR}/certs/CCP-key-server.pem" \
        -out "${INSTALLDIR}/certs/CCP-cert-server.pem"
    
    echo "Trust this self-signed certificate..."
    cp "${INSTALLDIR}/certs/CCP-cert-server.pem"     "/usr/local/share/ca-certificates/CCP-cert-server.crt"
    
    dpkg-trigger update-ca-certificates-fresh
 
fi
 
#DEBHELPER#