Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 62cba1b0
authored
2026-02-05 15:25:19 +0800
by
Administrator
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
创建证书
1 parent
394892ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
buildCer.sh
buildCer.sh
0 → 100644
View file @
62cba1b
#!/bin/bash
# 创建推送证书的完整脚本. 使用 OpenSSL 命令行
echo
"🚀 开始创建推送证书所需文件..."
# 创建目录
mkdir -p ~/Desktop/APNSCertificate
cd
~/Desktop/APNSCertificate
# 1. 生成私钥
echo
"1. 生成私钥..."
openssl genrsa -out apns_private.key 2048
echo
"✅ 私钥已生成: apns_private.key"
# 2. 生成 CSR
echo
"2. 生成 CSR 文件..."
# openssl req -new \
# -key apns_private.key \
# -out CertificateSigningRequest.certSigningRequest \
# -subj "/emailAddress=your.email@company.com/CN=APNS Certificate/O=$(whoami)/C=US"
openssl req -new
\
-key apns_private.key
\
-out CertificateSigningRequestApns.certSigningRequest
\
-subj
"/emailAddress=info@banxiaoer.com/CN=APNS Certificate/O=ZhongshanBanXiaoEr/C=US"
# 3. 创建 PEM 格式(备用)
openssl rsa -in apns_private.key -out apns_private.pem
echo
"✅ CSR 已生成: CertificateSigningRequest.certSigningRequest"
echo
""
echo
"📋 下一步操作:"
echo
"1. 访问 https://developer.apple.com"
echo
"2. 进入 Certificates → Add (+)"
echo
"3. 选择 'Apple Push Notification service SSL (Sandbox & Production)'"
echo
"4. 选择你的 App ID"
echo
"5. 上传此文件夹中的 CertificateSigningRequest.certSigningRequest"
echo
"6. 下载证书文件 (.cer)"
echo
""
echo
"⚠️ 重要:请保管好 apns_private.key 文件!"
security find-identity -p codesigning -v
security find-certificate -c
"Apple Push Services"
-Z
#############
创建 .p12 文件
#!/bin/bash
# 将 .cer 文件转换为 .p12
# 假设你的文件在桌面 APNSCertificate 文件夹
cd
~/Desktop/APNSCertificate
# 1. 将 .cer 转换为 .pem
echo
"将 .cer 证书转换为 PEM 格式..."
openssl x509 -in
"你的证书文件名.cer"
-inform DER -out certificate.pem
# 2. 创建 .p12 文件
echo
"创建 .p12 文件..."
openssl pkcs12 -export
\
-inkey apns_private.key
\
-in certificate.pem
\
-out apns_certificate.p12
echo
"✅ 完成!"
echo
"📁 .p12 文件: apns_certificate.p12"
echo
"🔑 需要设置密码(推送服务器配置时会用到)"
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment