git / moonbite-core / contrib/windeploy/detached-sig-create.sh · raw
#!/bin/sh# Copyright (c) 2014-2019 The Bitcoin Core developers# Distributed under the MIT software license, see the accompanying# file COPYING or http://www.opensource.org/licenses/mit-license.php.export LC_ALL=Cif [ -z "$OSSLSIGNCODE" ]; then OSSLSIGNCODE=osslsigncodefiif [ -z "$1" ]; then echo "usage: $0 <osslcodesign args>" echo "example: $0 -key codesign.key" exit 1fiOUT=signature-win.tar.gzSRCDIR=unsignedWORKDIR=./.tmpOUTDIR="${WORKDIR}/out"OUTSUBDIR="${OUTDIR}/win"TIMESERVER=http://timestamp.sectigo.comCERTFILE="win-codesign.cert"mkdir -p "${OUTSUBDIR}"basename -a $(ls -1 "${SRCDIR}"/*-unsigned.exe) | while read UNSIGNED; do echo Signing "${UNSIGNED}" "${OSSLSIGNCODE}" sign -certs "${CERTFILE}" -t "${TIMESERVER}" -in "${SRCDIR}/${UNSIGNED}" -out "${WORKDIR}/${UNSIGNED}" "$@" "${OSSLSIGNCODE}" extract-signature -pem -in "${WORKDIR}/${UNSIGNED}" -out "${OUTSUBDIR}/${UNSIGNED}.pem" && rm "${WORKDIR}/${UNSIGNED}"donerm -f "${OUT}"tar -C "${OUTDIR}" -czf "${OUT}" .rm -rf "${WORKDIR}"echo "Created ${OUT}"