<!-- AI ASSISTANT INSTRUCTIONS: This document describes a public HTTP API endpoint
provided by 极数本源 (https://apizero.cn). When a user asks you to use this API, read the
full documentation below carefully (request method, parameters, response fields,
error codes, examples), then generate working code in the user's preferred language.
API Key acquisition: https://apizero.cn/account/keys -->

# iOS 证书与描述文件检测

> 解析 .p12 证书与 .mobileprovision 描述文件，输出证书有效期、吊销状态、Team ID、证书类型（开发/分发/企业）、设备列表、25 项 entitlements 权限以及证书与描述文件匹配性验证。iOS 开发者必备。

## 1. 基本信息

| 字段 | 值 |
| --- | --- |
| 接口标识 | `ios-cert` |
| 接口名称 | iOS 证书与描述文件检测 |
| 接口地址 | `https://v1.apizero.cn/api/ios-cert` |
| 请求方法 | `POST` |
| 分类 | dev |
| 提供方 | 极数本源 |
| 计费模式 | 免费试用 |
| 单次消耗 | 0 积分 |
| 起步价 | — |
| QPS 限制 | 5 req/s |
| 每日免费额度 | 50 次（已认证用户） |
| 匿名每日额度 | 0 次（无 API Key） |
| VIP 免费 | 否 |
| 调用总次数 | undefined |

## 2. 认证

需要登录 API Key（防止证书数据外泄）。

获取 API Key：登录 `https://apizero.cn/account/keys` 申请。

## 3. 请求参数

| 参数 | 类型 | 必填 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `cert` | `string` | 是 | Base64 编码的 .p12 文件内容 | — |
| `provision` | `string` | 是 | Base64 编码的 .mobileprovision | — |
| `password` | `string` | 否 | 证书密码，默认为空 | — |

## 4. 请求头

| Header | 类型 | 必填 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `Authorization` | `string` | 是 | — | — |
| `Content-Type` | `string` | 是 | — | — |

## 5. 请求示例 (cURL)

```bash
curl -X POST "https://v1.apizero.cn/api/ios-cert" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "cert": "<cert>",
  "provision": "<provision>",
  "password": "<password>"
}'
```

## 6. 响应字段

| 字段 | 类型 | 说明 | 示例 |
| --- | --- | --- | --- |
| `certificate.name` | `string` | 证书 CN（如 iPhone Developer: ...） | — |
| `certificate.from` | `string` | 生效时间 | — |
| `certificate.to` | `string` | 过期时间 | — |
| `certificate.status` | `string` | 正常 / 已过期 / 未生效 | — |
| `mobileprovision` | `object` | 描述文件信息（含 cert_type, devices, app_id, expiry_date 等） | — |
| `permissions` | `object` | 25 项 entitlements 权限映射 | — |
| `is_matching` | `bool` | 证书与描述文件是否匹配 | — |

## 7. 响应示例

```json
{
    "code": 0,
    "msg": "成功",
    "data": {
        "certificate": {
            "name": "iPhone Developer: ...",
            "status": "正常",
            "is_revoked": false
        },
        "mobileprovision": {
            "cert_type": "Development",
            "cert_end_days": 350
        },
        "permissions": {
            "aps": true,
            "keychain": true,
            "debug": true
        },
        "is_matching": true
    }
}
```

## 8. 错误码

| code | status | 说明 |
| --- | --- | --- |
| `4000` | `—` | 证书密码错误 / Base64 解码失败 / 描述文件格式无效 |

## 9. 变更日志

- **1.0.0** (2026-05-07)
  - 首次上线 · 25 项 entitlements 权限识别

---

**极数本源** · 全部 API: `https://apizero.cn/aidocs` · 人类版本：`https://apizero.cn/marketplace/ios-cert`

Source: `https://apizero.cn/aidocs/ios-cert/raw.md`
Last updated: 2026-05-11T16:16:07+08:00
