Skip to content

Commit 979a884

Browse files
committed
update did wba signature service description
1 parent 3695f84 commit 979a884

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

chinese/03-did-wba方法规范.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ did:wba:example.com%3A3000
102102
"keyAgreement": [
103103
{
104104
"id": "did:wba:example.com%3A8800:user:alice#key-2",
105-
"type": "X25519KeyAgreementKey2019",
105+
"type": "X25519KeyAgreementKey2019",
106106
"controller": "did:wba:example.com%3A8800:user:alice",
107107
"publicKeyMultibase": "z9hFgmPVfmBZwRvFEyniQDBkz9LmV7gDEqytWyGZLmDXE"
108108
}
@@ -245,7 +245,7 @@ did:wba:example.com%3A3000:user:alice
245245
```mermaid
246246
sequenceDiagram
247247
participant Agent A Client
248-
participant Agent B Server
248+
participant Agent B Server
249249
participant Agent A DID Sever
250250
251251
Note over Agent A Client,Agent B Server: First Request
@@ -279,7 +279,7 @@ sequenceDiagram
279279
- **signature**:对 `nonce``timestamp` 、服务端域名、客户端DID进行签名。对于ECDSA签名,使用R|S格式。包括以下字段:
280280
- `nonce`: 随机生成的字符串
281281
- `timestamp`: 请求发起时的时间
282-
- `service`: 服务端域名(注意,域名中不包含端口)
282+
- `service`: 服务端域名(注意,域名中不包含端口,示例:example.com,如果服务端是ip,则使用ip地址)
283283
- `did`: 客户端的 DID
284284
客户端请求示例:
285285

@@ -292,13 +292,13 @@ Authorization: DIDWba did="did:wba:example.com%3A8800:user:alice", nonce="abc123
292292
1. 客户端生成包含以下信息的字符串:
293293

294294
```json
295-
{
296-
"nonce": "abc123",
297-
"timestamp": "2024-12-05T12:34:56Z",
298-
"service": "example.com",
299-
"did": "did:wba:example.com:user:alice"
295+
{
296+
"nonce": "abc123",
297+
"timestamp": "2024-12-05T12:34:56Z",
298+
"service": "example.com",
299+
"did": "did:wba:example.com:user:alice"
300300
}
301-
```
301+
```
302302

303303
2. 使用[JCS(JSON Canonicalization Scheme)](https://www.rfc-editor.org/rfc/rfc8785)对上面的json字符串进行规范化,生成规范化字符串。
304304

@@ -336,11 +336,11 @@ Authorization: DIDWba did="did:wba:example.com%3A8800:user:alice", nonce="abc123
336336
2. **构建验证字符串**:使用提取的信息构建与客户端相同的JSON字符串:
337337

338338
```json
339-
{
340-
"nonce": "abc123",
341-
"timestamp": "2024-12-05T12:34:56Z",
342-
"service": "example.com",
343-
"did": "did:wba:example.com:user:alice"
339+
{
340+
"nonce": "abc123",
341+
"timestamp": "2024-12-05T12:34:56Z",
342+
"service": "example.com",
343+
"did": "did:wba:example.com:user:alice"
344344
}
345345
```
346346

@@ -369,7 +369,7 @@ JWT生成方法参考[RFC7519](https://www.rfc-editor.org/rfc/rfc7519)。
369369
payload中可以包含以下字段(其他字段根据需要添加):
370370
```json
371371
{
372-
"sub": "did:wba:example.com:user:alice", // 用户 DID
372+
"sub": "did:wba:example.com:user:alice", // 用户 DID
373373
"iat": "2024-12-05T12:34:56Z", // 签发时间
374374
"exp": "2024-12-06T12:34:56Z", // 过期时间
375375
}
@@ -441,7 +441,7 @@ WWW-Authenticate: Bearer method="DIDWba,DIDWeb", error="invalid_nonce", error_de
441441
```mermaid
442442
sequenceDiagram
443443
participant Agent A Client
444-
participant Agent B Server
444+
participant Agent B Server
445445
participant Agent A DID Sever
446446
447447
Note over Agent A Client,Agent B Server: Initial Request
@@ -644,6 +644,6 @@ Alice希望通过智能助理调用一个名为example的第三方服务API。
644644

645645
15. **Controller Document**. Controller Document. Manu Sporny; Markus Sabadello. W3C. 24 June 2021. W3C Note. Retrieved from [https://www.w3.org/TR/controller-document/](https://www.w3.org/TR/controller-document/)
646646

647-
## 版权声明
648-
Copyright (c) 2024 GaoWei Chang
649-
本文件依据 [MIT 许可证](./LICENSE) 发布,您可以自由使用和修改,但必须保留本版权声明。
647+
## 版权声明
648+
Copyright (c) 2024 GaoWei Chang
649+
本文件依据 [MIT 许可证](./LICENSE) 发布,您可以自由使用和修改,但必须保留本版权声明。

0 commit comments

Comments
 (0)