🔐 License Tool
License Tool 是一個 基於 RSA 簽名驗證 的授權管理套件,提供:
- ✅ License 簽署(sign)
- ✅ License 驗證(verify)
- ✅ RSA 金鑰自動生成(genkeys)
📚 目錄
🚀 安裝方式
1️⃣ 本地安裝(開發模式)
git clone https://your.repo/license_tool.git
cd license_tool
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .
使用方式
- 必須進入license_tool的虛擬環境
- 查看指令功能
license-tool -h license-tool genkeys -h license-tool sign -h license-tool verify -h
金鑰產生
⚠️ gitlab clone下來的專案已經有keys
⚠️已經有金鑰就不要重複產生,否則金鑰可能覆蓋,造成已經生成的license失效
- 指令:
license-tool genkeys <output_dir>
- 範例: license-tool genkeys keys
- 📂 會產生以下兩個檔案:
keys/private.pem(⚠️ private.pem 絕對不能給出)keys/public.pem
License 生成
- 指令:
license-tool sign <license_file_path> <private_key>
- 範例: license-tool sign example/license.json keys/private.pem
- License file 格式請參考下列範例
{ "custom_name": "IOTech", "macs": [ "c8:d9:d2:19:fa:2c", "08:00:27:a6:59:dd", "08:00:27:6f:f7:c0" ], "expire_date": "2025-12-31 23:59:59", "deploy_cnt": "2", "signature": "" }
⚠️
license.json是原始未簽名的檔案,license_out.json是經簽名後產生的授權檔案,包含合法的signature欄位。
License 驗證
- 指令:
license-tool verify <license_path> <public_key> <host_mac>
- 範例: license-tool verify example/license_out.json keys/public.pem 08:00:27:6f:f7:c0
提交內容
- license檔案: 例如範例中的license_out.json
- Public Key: 例如範例中的public.pem
⚠️ Private Key 絕對不能給出
Metadata
Release files for license-tool-ias 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| license_tool_ias-0.2.2-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details for license_tool_ias-0.2.2-cp311-cp311-win_amd64.whl |
| license_tool_ias-0.2.2-cp311-cp311-musllinux_1_2_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux musl 1.2+ x86-64 | Details for license_tool_ias-0.2.2-cp311-cp311-musllinux_1_2_x86_64.whl |
| license_tool_ias-0.2.2-cp311-cp311-musllinux_1_2_aarch64.whl | CPython 3.11 | CPython 3.11 | Linux musl 1.2+ ARM64 | Details for license_tool_ias-0.2.2-cp311-cp311-musllinux_1_2_aarch64.whl |
| license_tool_ias-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64 | Details for license_tool_ias-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl |
| license_tool_ias-0.2.2-cp311-cp311-manylinux_2_28_aarch64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ ARM64 | Details for license_tool_ias-0.2.2-cp311-cp311-manylinux_2_28_aarch64.whl |
Total release size: 628.4 kB
Release files / license_tool_ias-0.2.2-cp311-cp311-win_amd64.whl
| Download URL | license_tool_ias-0.2.2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 98.7 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1d525b39c5e245b35777717bb981dcff3fa76524b0aca1d5915ecea9b67da7f9
|
|
BLAKE2b-256 checksum How to use checksums |
42974ad3a7aa95d4fc8aa58a829a53030f3b94d9e4c11b3e2c1731991563a934
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / license_tool_ias-0.2.2-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | license_tool_ias-0.2.2-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 133.6 kB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
891aac767744c82792e6c3cf7d05b27ddc4f670d857bd7b12208ce66d72b812c
|
|
BLAKE2b-256 checksum How to use checksums |
9c9625c1357987c7cacb4676d507467d4d8585ce50c385db66929df94f98aca5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / license_tool_ias-0.2.2-cp311-cp311-musllinux_1_2_aarch64.whl
| Download URL | license_tool_ias-0.2.2-cp311-cp311-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 131.3 kB |
| Tags | CPython 3.11 Linux musl 1.2+ ARM64 |
|
SHA-256 checksum How to use checksums |
4f18f5fa90bed000ca654ea3e09c79f67bd05bfa3578cb281b109ee53f6be532
|
|
BLAKE2b-256 checksum How to use checksums |
739f9972f301598037d1e589605551399296fc00ae0e13003e693591877f5e2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / license_tool_ias-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | license_tool_ias-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 132.0 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
3c63682f106b07b63f5a308ee491e3b405fce7581df70f0e6b6d3e3155fe72df
|
|
BLAKE2b-256 checksum How to use checksums |
7592a9fd9e1f6440a5362733661d471aafd881b728ddbebe88e40c1001ddd575
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / license_tool_ias-0.2.2-cp311-cp311-manylinux_2_28_aarch64.whl
| Download URL | license_tool_ias-0.2.2-cp311-cp311-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 132.8 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
2cd499d0b2822ad68ddc55f0f3afaef6c32a363f102c95540ddc714fe3010199
|
|
BLAKE2b-256 checksum How to use checksums |
6127d1de3853de84b6d3a09623f68205d6f002f63e731caaa57f5295eab6c7d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for license-tool-ias 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.