chromium/components/test/data/device_signals/README

This directory contains some executable files for testing the Binary files
signals extraction.

Description of the files:

TestApp.app
Simple test app bundle that is signed and has the following properties:
- Product Name: TestApp
- Product Version: 10.8

TestApp.app
Simple test app bundle that is not signed and does not have product name or version.

Instructions for signing an executable (e.g. signed.exe):
- Open PowerShell (with admin privileges),

- Run this command and copy the output cert's thumbprint:
New-SelfSignedCertificate -Type CodeSigningCert -Subject "CN=SebL's-Software-Emporium"

- Run this command to store a password in a local variable:
$mypwd = ConvertTo-SecureString -String "1231233!a" -Force -AsPlainText

- Export the certificate to a pfx file using the <thumbprint> you copied
Get-ChildItem -Path cert:\localMachine\my\<thumbprint> | Export-PfxCertificate -FilePath C:\self-signed.pfx -Password $mypwd

- Now open a Windows SDK command prompt with admin privileges (you can access
  such prompt inside Visual Studio if you open it with admin privileges).
- Run this codesign command (update the path to your executable to be signed):
signtool sign /f C:\self-signed.pfx /p "1231233!a" C:\signed.exe

Instructions for adding a second signature to an executable (e.g. multi-signed.exe):
- Follow all of the steps as above (you can change the Subject name for the new
cert), but when you get to run the "signtool" command, add the /as flag to append
the signature (instead of overwriting it).
signtool sign /as /f C:\self-signed.pfx /p "1231233!a" C:\signed.exe

Do not commit actual exe files. Instead, you can generate them at runtime from
base64 encoded bytes. See this test utility as example:
//components/device_signals/test/win/scoped_executable_files.h

Instructions for signing the TestApp.app bundle:
- Create a self-signed certificate in the login keychain via Keychain access
- Sign the bundle with this command:
codesign -s <certificate name> ./CalculatorFake.app