mac通过命令行获取证书和配置文件过期时间
cd /Users/a58/Library/MobileDevice/Provisioning Profiles
for file in $(ls *)
do
if [[ $(/usr/libexec/PlistBuddy -c "Print TeamName" /dev/stdin <<< $(/usr/bin/security cms -D -i ${file})) == "${TeamName}" ]]
then
#echo "I get you!"
profile=${file}
#break
#else
# echo "it's not you "
fi
done
ExpirationDate=`/usr/libexec/PlistBuddy -c "Print ExpirationDate" /dev/stdin <<< $(/usr/bin/security cms -D -i xxxx.mobileprovision)`
例如:要查找下面内容中com.apple.developer.team-identifier的值
<key>Entitlements</key>
<dict>
<key>keychain-access-groups</key>
<array>
<string>xxxx.*</string>
</array>
<key>get-task-allow</key>
<false/>
<key>application-identifier</key>
<string>7xxx.push</string>
<key>com.apple.developer.team-identifier</key>
<string>xxxx</string>
<key>aps-environment</key>
<string>production</string>
</dict>
/usr/libexec/PlistBuddy -c "Print Entitlements:com.apple.developer.team-identifier" /dev/stdin <<< $(/usr/bin/security cms -D -i ${file})
例如:要获得数组下第二个值
<key>ProvisionedDevices</key>
<array>
<string>xxx</string>
<string>xxx</string>
</array>
/usr/libexec/PlistBuddy -c 'Print ProvisionedDevices:2' /dev/stdin <<< `/usr/bin/security cms -D -i ${file}`
curl https://raw.githubusercontent.com/0xc010d/mobileprovision-read/master/main.m | clang -framework Foundation -framework Security -o /usr/local/bin/mobileprovision-read -x objective-c -
mobileprovision-read -f xxxx.mobileprovision -o ExpirationDate
security find-certificate -a -c "iPhone xxxx" -p > certs.pem

security export -f pkcs12 -k /Users/a58/Library/Keychains/login.keychain -o /opt/temp.p12 -P
security export -f pkcs12 -k /Users/a58/Library/Keychains/login.keychain -o /opt/temp.p12 -P -t identities "iPhone xxx"
openssl pkcs12 -clcerts -nokeys -in temp.p12 -out cert.pem -passin pass:
openssl x509 -in cert.pem -noout -text
mac通过命令行获取证书和配置文件过期时间的更多相关文章
- 用OpenSSL命令行生成证书文件
用OpenSSL命令行生成证书文件 1.首先要生成服务器端的私钥(key文件): openssl genrsa -des3 -out server.key 1024 运行时会提示输入密码,此密码用于加 ...
- Shell 命令行获取本机IP,grep的练习
Shell 命令行获取本机IP,grep的练习 在 mac 下面输入 ifconfig 或者在 linux 下面输入 ip a 就可以得到我们的网卡信息.不过通常情况下,我们需要查看的是我们的IP地址 ...
- Mac 在命令行中获得Root权限
Mac 在命令行中获得Root权限 作者 firedragonpzy 13 九月, 2012 2条评论 本文为firedragonpzy原创,转载务必在明显处注明:转载自[Softeware MyZo ...
- linux/mac下命令行rm回收站--rmtrash
Linux.mac的命令行下没有回收站功能,很多时候手一抖就把重要文件给 rm -fr * 了,虽然linux下有可能通过lost +found/debugfs找回,但难度也比较大,不能保证一定能够找 ...
- 在mac上命令行里面如何打开文本编辑器?
在mac上命令行里面如何打开文本编辑器? 在linux命令行terminal上使用gedit直接就可以打开文本文件 那么在mac上面如何操作呢? 使用:open -a TextEdit setti ...
- 命令行获取docker远程仓库镜像列表
命令行获取docker远程仓库镜像列表 获取思路 通过curl获取镜像tag的json串,解析后得到${image}:${tag}的格式 curl获取示例 # curl [:-s] ${API}/${ ...
- python命令行获取参数
python命令行获取参数 import sys # python获取参数 input_file = sys.argv[1] output_file = sys.argv[2] print(input ...
- Mac下用命令行获取苹果手机的UDID
在终端输入命令行:system_profiler SPUSBDataType | grep "Serial Number:.*" | sed s#".*Serial Nu ...
- Mac终端命令行提示符格式更改方法
内容提要: 主要是通过~/.bash_profile文件更改环境变量PS1,修改命令行提示符的显示格式,并展示不同颜色. 本文介绍了默认设置的缺陷,以及需要用到的基础知识,最后介绍了更改命令行提示符格 ...
随机推荐
- ucenter
1 UCenter 的目录结构 2API接口 3返回标签数据示例 (PHP) 4应用接口函数 5短消息接口函数 6积分接口函数 7邮件接口函数 8事件接口函数 9头像接口函数 10好友接口函数 11用 ...
- GitHub使用指南之快速入门
出自http://blog.csdn.net/column/details/13170.html 1.Git安装 Git是一个版本控制系统,使用之前必须先下载安装,下面提供各平台的安装方式. Mac: ...
- Android Camera2的使用
参考:https://developer.android.com/reference/android/hardware/camera2/package-summary.html camera2提供了一 ...
- [记录] Mysql 复制表格结构
有时候我们需要原封不动的复制一张表的表结构来生成一张新表,MYSQL提供了两种便捷的方法 一.LIKE方法 like方法能一模一样的将一个表的结果复制生成一个新表,包括复制表的备注.索引.主键外键.存 ...
- 获取数据库表中自增长最新的id
mybatis <insert id="InsertCourse"> insert into training_course(type_id,course_title, ...
- JQuery中bind和unbind函数与onclick绑定事件区分
JQuery中bind和unbind函数转载: https://blog.csdn.net/liucheng417/article/details/51131982 页面代码: <body& ...
- Linux:TCP状态/半关闭/2MSL/端口复用
TCP状态 CLOSED:表示初始状态. LISTEN:该状态表示服务器端的某个SOCKET处于监听状态,可以接受连接. SYN_SENT:这个状态与SYN_RCVD遥相呼应,当客户端SOCKET执行 ...
- How to Pronounce AR, ORN, etc.
How to Pronounce AR, ORN, etc. Share Tweet Share The R consonant can be really tricky. In this vide ...
- 【376】COMP 9021 相关笔记(二)
Note_01 zip() itertools.zip_longest() %time Note_02 for 循环单行输出 list 技巧 迭代器 生成器 map() zip() from path ...
- 自定义标签在IE6-8的困境
或许未来前端组件化之路都是自定义标签,但这东西早在20年前,JSTL已在搞了.现在Web Component还只有webkit支持.但一个组件库,还需要一个特殊的标识它们是一块的.不过这个XML已经帮 ...