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,修改命令行提示符的显示格式,并展示不同颜色. 本文介绍了默认设置的缺陷,以及需要用到的基础知识,最后介绍了更改命令行提示符格 ...
随机推荐
- code signing is required for product type 'Application' in SDK 'iOS 8.1' 错误分析以及解决方案
在真机测试的时候往往会突然出现这样一个错误,code signing is required for product type 'Application' in SDK 'iOS 7.0' ,就是说 ...
- C++学习基础十五--sizeof的常见使用
sizeof的常见用法 1. 基本类型所占的内存大小 类型 32位系统(字节) 64位系统(字节) char 1 1 int 4 4 short 2 2 long 4 8 float 4 4 doub ...
- linux常用命令以及快捷键
find命令查找某些文件并将其拷贝到指定目录 [root@host lib]# find -name "*hbase*.jar" |xargs -i cp {} /root/aa ...
- 【Flex】自定义组件-combobox组件
1包结构 2 Test.mxml <?xml version="1.0" encoding="utf-8"?> <s:Application ...
- Flex学习笔记PopUpMenuButton
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="ht ...
- Python中续行符的注意事项
转载自:https://blog.csdn.net/g_66_hero/article/details/78745608
- 使用STM32CubeMX生成待机开关功能
使用的开发板为MINISTM32 通过长按数秒KEY_UP 按键开机,并且通过 DS1 的闪烁指示程序已经开始运行,再次长按该键,则进入待机模式, DS1 关闭,程序停止运行.利用STM32的stan ...
- Cobbler自动化工具实践
1.Cobbler Install 安装前准备 /*注:Cobbler需安装在CentOS7机器上面,建议安装Cobbler机器的CentOS7 everything版本*/ 关闭SELinux c ...
- How to Pronounce the Word OR
How to Pronounce the Word OR Share Tweet Share Tagged With: OR Reduction Study the OR reduction. Th ...
- mysql 忘记密码解决方案
Mysql 忘记root密码的完美解决方法 转载 2016-12-23 作者:MR.QiGao 我要评论 通常在使用Mysql数据库时,如果长时间没有登陆,或者由于工作交接完成度不高,会导 ...