

本指南記載於 2025 年 3 月 13 日發行的新 AWS Wickr 管理主控台。如需 AWS Wickr 管理主控台傳統版本的文件，請參閱[傳統管理指南](https://docs.aws.amazon.com/wickr/latest/adminguide-classic/what-is-wickr.html)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 存取保留的資料
<a name="retained-data"></a>

## S3 儲存貯體結構
<a name="bucket-structure"></a>

保留的資料會使用以日期為基礎的階層組織在您的 S3 儲存貯體中：

```
s3:{{//your-retention-bucket/}}
wickr-drs-encrypted/YYYY/MM/DD/<vgroupid>/{file | message | username}
```

## 檔案命名慣例
<a name="file-naming"></a>

所有檔案都是：在加密的儲存貯體`{message sequence number}-{message id}.json`中。檔案為 `{message sequence number}-{message id}.bin`。

## 觸發隨需解密
<a name="decryption"></a>

S3 中的訊息會使用 KMS 金鑰加密。完成下列程序，以使用 **Step Functions** 狀態機器隨需解密。

**在 AWS 主控台中**：

1. 導覽至 主控台中的 AWS **Step Functions**。

1. 選取`DecryptionStateMachine`。

1. 選擇 **Start execution (開始執行)**。

1. 提供輸入 JSON：

   ```
   {
    "startDate": {{"2026-06-03",}}
    "endDate": {{"2026-06-04",}}
    "vgroupid": {{"ABC123",}}
   }
   ```

1.  即時監控執行進度。

1.  完成後，解密的檔案會出現在解密的儲存貯體中。

**在 中 AWS CLI**：

```
aws stepfunctions start-execution \
 —state-machine-arn arn:aws:states:us-east-1:123456789012:stateMachine:DecryptionStateMachine \
 —input '{
    "startDate": {{"2026-06-03",}}
    "endDate": {{"2026-06-04",}}
    "vgroupid": {{"ABC123",}}
```

## 讀取解密的檔案：
<a name="decrypted-files"></a>

您可以直接從解密的 S3 儲存貯體讀取解密的檔案。

```
import boto3
s3 = boto3.client({{'s3'}})
response = s3.get_object(
    Bucket={{'your-retention-bucket-decrypted'}},
    Key={{'wickr-drs/2026/03/20/vgroupid_ABC123/message1.txt'}}
)
content = response[{{'Body'}}].read().decode({{'utf-8'}})
print(content)
```