bash <(curl -s https://raw.githubusercontent.com/in-toto/witness/main/install-witness.sh) Latest version of Witness is 0.1.14 Downloading for linux amd64 from https://github.com/in-toto/witness/releases/download/v0.1.14/witness_0.1.14_linux_amd64.tar.gz expected checksum: f9b67ca04cb391cd854aec3397eb904392ff689dcd3c38305d38c444781a5a67 file checksum: f9b67ca04cb391cd854aec3397eb904392ff689dcd3c38305d38c444781a5a67 witness v0.1.14-aa35c1f Witness v0.1.14 has been installed at /usr/local/bin/witness
witness run --step build -o witness-demo-att.json -- python3 -m pip wheel --no-deps -w dist . INFO Using config file: .witness.yaml INFO Starting environment attestor... INFO Starting git attestor... INFO Starting material attestor... INFO Starting command-run attestor... Processing /tmp/witness-demo Building wheels for collected packages: witness-demo Running setup.py bdist_wheel for witness-demo: started Running setup.py bdist_wheel for witness-demo: finished with status 'done' Stored in directory: /tmp/witness-demo/dist Successfully built witness-demo INFO Starting product attestor...
witness sign -f policy.json --signer-file-key-path witness-demo-key.pem --outfile policy-signed.json INFO Using config file: .witness.yaml
验证二进制文件是否符合政策要求
witness verify -f dist/witness_demo-1.0.0-py3-none-any.whl -a witness-demo-att.json -p policy-signed.json -k witness-demo-pub.pem INFO Using config file: .witness.yaml INFO Verification succeeded INFO Evidence: INFO 0: witness-demo-att.json