signstar-client 0.1.0

Library and executable for creating, reading and writing of signing requests for files
Documentation
# Signstar Request Signature

> [!WARNING]
>
> This crate is deprecated in favor of a more general one.
> Please visit the [Signstar website] to learn more about the binaries relevant for a Signstar client.

This crate offers a library and an executable for creating, reading and writing of signing requests for files.

## Documentation

- <https://signstar.archlinux.page/rustdoc/signstar_client/> for development version of the crate
- <https://docs.rs/signstar_client/> for released versions of the crate
- [Design document] and specifications for [requests] and [responses]

## Preparing signing request

The tool can be used to prepare a raw JSON signing request:

```bash
signstar-client prepare Cargo.toml
```

## Sending the signing request over SSH

Additionally it's possible to prepare the signing request and send it over SSH in one command.

<!--
```bash
# start SSH agent
agent=$(mktemp -u)
eval "$(ssh-agent -a "$agent")"

trap 'kill $SSH_AGENT_PID' EXIT INT TERM

# generate new key and add it to the agent
key_file=$(mktemp -u)
ssh-keygen -f "$key_file" -N ""
ssh-add "$key_file"
ssh-add -L | tee "tests/sshd/authorized_keys"

set +x
counter=0
until ssh-keyscan -p 2222 127.0.0.1 2> /dev/null; do
  printf "Test container is not ready, waiting (try %d)...\n" "$counter"
  sleep 2
  counter=$(( counter + 1 ))
  # we need a high value here since the entire openssh server installation and setup
  # is happening while we wait
  if (( counter > 50 )); then
    printf "Test container is not up even after 50 tries. Aborting."
    set -x
    exit 2
  fi
done
set -x

known_host_entry="$(ssh-keyscan -q -t ed25519 -p 2222 127.0.0.1)"

config="$(mktemp)"
cat > "$config" << EOF

[hosts.localhost]
host = "127.0.0.1"
port = 2222
known_hosts = ["$known_host_entry"]

[users.signstar-sign]
agent_socket = "$agent"
user_public_key = "$(cat tests/sshd/authorized_keys)"
hosts = ["localhost"]
EOF
```
-->
`send` subcommand requires parameters related to SSH session:

```bash
signstar-client send --config "$config" --user signstar-sign Cargo.toml | jq
```

<!--
```bash
rm "$config"
```
-->

## Features

- `_containerized-integration-test`: Integration tests that require a containerized test environment.
  **NOTE**: Unless you are developing this crate, you will very likely not want to use this feature.
- `cli`: Enables command line interface for creating and sending signing requests

## Contributing

Please refer to the [contributing guidelines] to learn how to contribute to this project.

## License

This project may be used under the terms of the [Apache-2.0] or [MIT] license.

Changes to this project - unless stated otherwise - automatically fall under the terms of both of the aforementioned licenses.

[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0
[contributing guidelines]: ../CONTRIBUTING.md
[Design document]: https://signstar.archlinux.page/signing-api/design.html
[MIT]: https://opensource.org/licenses/MIT
[contributing guidelines]: ../CONTRIBUTING.md
[requests]: https://signstar.archlinux.page/signing-api/request.html
[responses]: https://signstar.archlinux.page/signing-api/response.html
[Signstar website]: https://signstar.archlinux.page