Einzelnen Beitrag anzeigen

Benutzerbild von paule32.jk
paule32.jk

Registriert seit: 24. Sep 2022
Ort: Planet Erde
312 Beiträge
 
Delphi 11 Alexandria
 
#91

AW: Code Sign Zertifikat

  Alt 29. Aug 2024, 18:02
Moin Moin,
ich habe das nicht so tief verfolgt (den Thread hier) - nur so weit, das eine Executable signiert werden soll ?
Man kann ja erstmal ALLES lokal testen, bevor man bei "Code Sign" oder einer anderen CA seines Vertrauens ein Zertifikat für teuer bestellt - weil das geht fast problemlos auch ohne (also Eigene CA und Self Sign Cert).

Dazu muss/ist die im Microsoft SDK vorhandene signtool.exe erforderlich.
Und das Zertifikat muss dann dem Provider (der Lokale Rechner) bekannt gemacht werden.

Dazu verwende ich als Template folgendes PowerShell Script:

Code:
# ---------------------------------------------------------------------------
# File:  gencert.cmd - generate a certificate fot executable signing.
# Author: Jens Kallup - paule32
#
# Rights: (c) 2024 by kallup non-profit software
#         all rights reserved
#
# only for education, and for non-profit usage !!!
# commercial use ist not allowed.
#
# To create the certificate, copy lines 13, ..., 19 into the clipboard, and
# paste the copied text into powershell console. Press return, and voila:
# you have a self signed certificate into your local certification store.
# ---------------------------------------------------------------------------
New-SelfSignedCertificate `
    -Type Custom         `
    -Subject "CN=kallup non-profit" `
    -KeyUsage DigitalSignature     `
    -FriendlyName "chmFilter"      `
    -CertStoreLocation "Cert:\CurrentUser\My" `
    -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3","2.5.29.19={text}")

$password = ConvertTo-SecureString -String "mypassword" -Force -AsPlainText
Export-PfxCertificate -cert "Cert:\CurrentUser\My\<fingerprint thumb>" -FilePath certificate.pfx -Password $password

# now, in the Visual Studio C++ Console:
# signtool sign /f ./certificate.pfx /p mypassword /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 observer.exe
muss natürlich angepasst werden.
HTH - Hope This Helps
Frag doch einfach
Alles was nicht programmiert werden kann, wird gelötet
  Mit Zitat antworten Zitat