Files
1818web-hoduan/certs/README.md
2025-11-14 17:41:15 +08:00

54 lines
1.4 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.

# 密钥文件目录说明
## 目录结构
```
certs/
├── README.md # 本说明文档
├── wechat/ # 微信支付相关密钥文件
│ ├── README.md # 微信支付密钥说明
│ └── .gitkeep # 保持目录结构的占位文件
└── .gitignore # Git忽略文件配置
```
## 安全注意事项
⚠️ **重要提醒**:此目录包含敏感信息,请务必注意以下安全事项:
1. **不要将密钥文件提交到Git仓库**
2. **定期更换密钥文件**
3. **限制密钥文件的访问权限**
4. **备份密钥文件到安全位置**
5. **生产环境使用环境变量或密钥管理服务**
## 密钥文件类型
### 微信支付
- `apiclient_cert.p12` - 微信支付商户证书
- `apiclient_key.pem` - 微信支付私钥文件
- `apiclient_cert.pem` - 微信支付公钥文件
### 其他支付方式
- 支付宝、银联等支付方式的密钥文件
## 使用方法
1. 将相应的密钥文件放入对应目录
2.`application.yml` 中配置正确的文件路径
3. 确保应用有读取密钥文件的权限
## 环境变量配置
建议使用环境变量来配置密钥文件路径:
```bash
# 微信支付证书路径
WX_CERT_URL=/path/to/certs/wechat/apiclient_cert.p12
```
## 生产环境建议
1. 使用密钥管理服务如AWS KMS、阿里云KMS等
2. 使用Docker Secrets或Kubernetes Secrets
3. 定期轮换密钥
4. 监控密钥访问日志