Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1#!/bin/sh2# Copyright (c) 2014-present The Bitcoin Core developers3# Distributed under the MIT software license, see the accompanying4# file COPYING or http://www.opensource.org/licenses/mit-license.php.6export LC_ALL=C.UTF-87if [ -z "$OSSLSIGNCODE" ]; then8OSSLSIGNCODE=osslsigncode9fi11if [ "$#" -ne 1 ]; then12echo "usage: $0 <path to key>"13echo "example: $0 codesign.key"14exit 115fi17OUT=signature-win.tar.gz18SRCDIR=unsigned19WORKDIR=./.tmp20OUTDIR="${WORKDIR}/out"21OUTSUBDIR="${OUTDIR}/win"22TIMESERVER=http://timestamp.comodoca.com23CERTFILE="win-codesign.cert"25stty -echo26printf "Enter the passphrase for %s: " "$1"27read cs_key_pass28printf "\n"29stty echo32mkdir -p "${OUTSUBDIR}"33find ${SRCDIR} -wholename "*.exe" -type f -exec realpath --relative-to=. {} \; | while read -r bin34do35echo Signing "${bin}"36bin_base="$(realpath --relative-to=${SRCDIR} "${bin}")"37mkdir -p "$(dirname ${WORKDIR}/"${bin_base}")"38"${OSSLSIGNCODE}" sign -certs "${CERTFILE}" -t "${TIMESERVER}" -h sha256 -in "${bin}" -out "${WORKDIR}/${bin_base}" -key "$1" -pass "${cs_key_pass}"39mkdir -p "$(dirname ${OUTSUBDIR}/"${bin_base}")"40"${OSSLSIGNCODE}" extract-signature -pem -in "${WORKDIR}/${bin_base}" -out "${OUTSUBDIR}/${bin_base}.pem" && rm "${WORKDIR}/${bin_base}"41done43rm -f "${OUT}"44tar -C "${OUTDIR}" -czf "${OUT}" .45rm -rf "${WORKDIR}"46echo "Created ${OUT}"
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.