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,修改命令行提示符的显示格式,并展示不同颜色. 本文介绍了默认设置的缺陷,以及需要用到的基础知识,最后介绍了更改命令行提示符格 ...
随机推荐
- python venv actieve uninstall pack-name sitepage
- py库: pyautogui (自动测试模块,模拟鼠标、键盘动作)
PyAutoGUI 是一个人性化的跨平台 GUI 自动测试模块 pyautogui 库 2017-10-4 pip install pyautogui python pip.exe install p ...
- iOS工程结构理解
iOS开发中关于工程结构有三个关键部分,分别是:Targets,projects 和 workspaces. Targets指定了工程或者库文件如何编译,包括building setting,comp ...
- centos使用记
20180404:今天在笔记本上安装了centos6.9,第一次安装的7.4时进不了安装界面,后来下载了6.9版的,可以安装.安装完后启动时出现fail reg的错误,然后提示登陆,不知是用户名为:r ...
- vs2008 "不安全代码只会在使用 /unsafe 编译的情况下出现"的解决方法
原因是:在编译的代码里面有不安全类型unsafe方法或类! 解决方法:将项目的“可编译不安全代码”属性设置为true就可以了,方法如下:项目属性对话框->配置属性->生成->允许不安 ...
- vue下载和上传excle数据文件,解析excel文件数据并存在数据库中
下载: VUE: window.open("xxxx/downloadOldTaskDataFile.do_", "_blank"); JAVA: /** * ...
- JEECG新版UI规划,主要提供H5方案(采用主流技术)
JEECG 结合当前主流的UI技术,在新版3.7.4 即将推出新的UI方案,主要采用Bootstrap,Vue技术.同时提供代码生成器模板(单表.一对多),快速生成你喜好的模板代码. 版本一: Boo ...
- 利用docker-machine安装swarm
转自:https://www.cnblogs.com/jsonhc/p/7832642.html 安装之前的环境: 两个节点,节点1:192.168.101.14,用来创建manager1 machi ...
- 使用大于16TB的ext4文件系统
我们的电脑想要快速开机,需要具备三个条件:第一是主板支持UEFI,二是系统支持UEFI(Win8),最后就硬盘需要采用GPT分区. GPT分区全名为Globally Unique Identifier ...
- servlet中请求转发(forword)与重定向(sendredirect)
请求转发和重定向 request.setAttribute("test","hello"); request.getRequestDispacther(&quo ...