Set up environment
To set up your environment:
In the folder where you want your project, run:
cargo new my_project
Replace the project name with the name of your choice.
Replace the generated src/main.rs with the main.rs mentioned in reference files.
Copy lib.rs file located in reference files into to the folder src (src/lib.rs).
Open Cargo.toml and enter the details as below:
[package] name = "tool" version = "0.1.0" edition = "2021" [dependencies] base64 = "0.21" c2pa = "0.43.0" # adjust to match the version you already use request = { version = "0.11", features = ["blocking", "rustls-tls", "native-tls", "json"] } sha2 = "0.10" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" log = "0.4" env_logger = "0.10" [[bin]] name = "remote-signer" path = "src/main.rs"Ensure that you enter the correct name of the folder in which all your project files including Cargo.toml are saved. Access Cargo.toml from the reference files.
Build and run the project from the directory my_project.
Use commands
cargo build --releaseto build the executable that internally calls DigiCert ONE CSC APIs to get the manifest signed. This executable receives the claim bytes (the bytes to be signed) from standard input (stdin) and outputs the signature bytes to standard output (stdout).Note
Ensure the client authentication certificate, user certificate and chain, the image to be signed and the manifest are saved in the same directory.