![](https://img.shields.io/pypi/l/solo-python.svg?style=flat) ![](https://img.shields.io/pypi/pyversions/solo-python.svg?style=flat) ![](https://img.shields.io/pypi/v/solo-python.svg) ![](https://img.shields.io/pypi/wheel/solo-python.svg?style=flat)
# Python tool and library for SoloKeys
## Getting Started
We require Python >= 3.6 and corresponding `pip3` command.
We intend to support Linux, Windows and macOS. Other platforms aren't supported by the [FIDO2 library](https://github.com/Yubico/python-fido2) we rely on.
To get started, run `pip3 install solo-python`, this installs both the `solo` library and the `solo` interface.
Possible issues:
- on Linux, ensure you have suitable udev rules in place: <https://docs.solokeys.dev/solo/udev/>
- on Windows, optionally install a libusb backend: <https://github.com/libusb/libusb/wiki/Windows#driver-installation>
For development, we suggest you run `make init` instead, which
- sets up a virtual environment
- installs development requirements such as `black`
- installs `solo` as symlink using our packaging tool `flit`, including all runtime dependencies listed in [`pyproject.toml`](pyproject.toml)
One way to ensure the virtual environment is active is to use [direnv](https://direnv.net/).
## Solo Tool
For help, run `solo --help` after installation. The tool has a hierarchy of commands and subcommands.
Example:
```bash
solo ls # lists all Solo keys connected to your machine
solo version # outputs version of installed `solo` library and tool
solo key wink # blinks the LED
solo key verify # checks whether your Solo is genuine
solo key rng hexbytes # outputs some random hex bytes generated on your key
solo key version # outputs the version of the firmware on your key
```
## Firmware Update
Upon release of signed firmware updates in [solokeys/solo](https://github.com/solokeys/solo),
to update the firmware on your Solo to the latest version:
- update your `solo` tool if necessary via `pip3 install --upgrade solo-python`
- plug in your key, keeping the button pressed until the LED flashes yellow
- run `solo key update`
For possibly helpful additional information, see <https://github.com/solokeys/solo/issues/113>.
## Library Usage
The previous `solotool.py` has been refactored into a library with associated CLI tool called `solo`.
It is still work in progress, example usage:
```python
import solo
client = solo.client.find()
client.wink()
random_bytes = client.get_rng(32)
print(random_bytes.hex())
```
Comprehensive documentation coming, for now these are the main components
- `solo.client`: connect to Solo Hacker and Solo Secure keys in firmware or bootloader mode
- `solo.dfu`: connect to Solo Hacker in dfu mode (disabled on Solo Secure keys)
- `solo.cli`: implementation of the `solo` command line interface
## Challenge-Response
By abuse of the `hmac-secret` extension, we can generate static challenge responses,
which are scoped to a credential. A use case might be e.g. unlocking a LUKS-encrypted drive.
**DANGER** The generated reponses depend on both the key and the credential.
There is no way to extract or backup from the physical key, so if you intend to use the
"response" as a static password, make sure to store it somewhere separately, e.g. on paper.
**DANGER** Also, if you generate a new credential with the same `(host, user_id)` pair, it will likely
overwrite the old credential, and you lose the capability to generate the original responses
too.
**DANGER** This functionality has not been sufficiently debugged, please generate GitHub issues
if you detect anything.
There are two steps:
1. Generate a credential. This can be done with `solo key make-credential`, storing the
(hex-encoded) generated `credential_id` for the next step.
2. Pick a challenge, and generate the associated response. This can be done with
`solo key challenge-response <credential_id> <challenge>`.
## License
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
http://www.apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
## Contributing
Any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Code is to be formatted and linted according to [Black](https://black.readthedocs.io/) and our [Flake8](http://flake8.pycqa.org/en/latest/) [configuration](.flake8)
Run `make check` to test compliance, run `make fix` to apply some automatic fixes.
We keep a [CHANGELOG](CHANGELOG.md).
## Releasing
For maintainers:
- adjust `solo/VERSION` file as appropriate
- add entry or entries to `CHANGELOG.md` (no need to repeat commit messages, but point out major changes
in such a way that a user of the library has an easy entrypoint to follow development)
- run `make check` and/or `make fix` to ensure code consistency
- run `make build` to double check
- run `make publish` (assumes a `~/.pypirc` file with entry `[pypi]`), or `flit publish` manually
- run `make tag` to tag the release and push it
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
资源分类:Python库 所属语言:Python 资源全名:solo-python-0.0.22.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
solo-python-0.0.22.tar.gz (31个子文件)
solo-python-0.0.22
PKG-INFO 195B
solo
fido2
__init__.py 1KB
operations.py 8KB
hmac_secret.py 3KB
enums.py 507B
commands.py 2KB
client.py 13KB
helpers.py 1KB
__init__.py 647B
dfu.py 8KB
VERSION 7B
solotool.py 10KB
exceptions.py 751B
cli
program.py 8KB
__init__.py 5KB
update.py 7KB
_patches.py 4KB
key.py 15KB
monitor.py 1KB
LICENSE-MIT 1023B
pyproject.toml 868B
LICENSE-APACHE 10KB
dev-requirements.txt 158B
setup.py 791B
.gitignore 180B
CHANGELOG.md 4KB
Makefile 911B
.envrc 78B
README.md 5KB
.editorconfig 192B
.flake8 244B
共 31 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 20000m3甲醇储罐现场安装与焊接.pdf
- A304不锈钢薄板激光焊接的光谱分析.pdf
- A335 P22厚壁管道的焊接技术在施工中的应用.pdf
- A671Gr.CC60低温钢管道的焊接.pdf
- AH70DB钢焊接热影响区组织及其冷裂敏感性 - .pdf
- ALCHIPTM-系列纵型品焊接推荐条件.pdf
- Alloy20铁镍基合金焊接 - .pdf
- Al异种金属焊接研究现状 - .pdf
- AP1000非能动余热排出热交换器的焊接.pdf
- AQ 4214-2011 焊接工艺防尘防毒技术规范(非正式版).pdf
- AQT 4237-2014 焊接烟尘净化器通用技术条件.pdf
- ASME B36.10M-2004 焊接和无缝轧制钢管(英文).pdf
- ASME B29.21M-1996(R2003) 水、污水处理设备用700等级的焊接钢和铸造链、连接件及链轮.pdf
- ASME管道焊接方案和焊接工艺规程.pdf
- ASME规范焊接工艺及装备研讨会资料.pdf
- ASME规范焊接工艺及准备研讨会讲义.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功