NFCcreate-web/linux64_release/README_API.md
2025-09-25 19:04:00 +08:00

59 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# NTAG424 CMAC 驗證 API
🚀 **輕量級 HTTP API 服務,提供 NTAG424 卡片 CMAC 驗證功能**
## 🎯 快速開始
### 1. 啟動 API 服務器
```bash
./cmac_api_server 8888
```
### 2. 測試 API
```bash
# 健康檢查
curl "http://localhost:8888/health"
# CMAC 驗證
curl "http://localhost:8888/verify?uid=0456735AD51F90&ctr=000028&cmac=222ED1BA962F7F5C&key=1"
```
### 3. 執行完整測試
```bash
./test_api.sh
```
## 📁 相關檔案
- `cmac_api_server` - API 服務器執行檔
- `test_api.sh` - API 功能測試腳本
- `API_DOCUMENTATION.md` - 完整 API 文檔
- `keys.txt` - AES 金鑰配置檔案
## 🌐 API 端點
- `GET /verify` - CMAC 驗證(需要 uid, ctr, cmac, key 參數)
- `GET /health` - 健康檢查
- `GET /` - API 說明頁面
## ✨ 特點
- ✅ 純軟體驗證,無需讀卡機
- ✅ HTTP RESTful API
- ✅ JSON 回應格式
- ✅ 多金鑰支援 (1-10)
- ✅ 多執行緒處理
- ✅ CORS 支援
## 📖 詳細文檔
查看 [API_DOCUMENTATION.md](./API_DOCUMENTATION.md) 獲取:
- 完整 API 規格
- 使用範例cURL, JavaScript, Python
- 部署指南
- 安全建議
- 故障排除
---
**製作**: 基於 NTAG424 管理工具開發