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,修改命令行提示符的显示格式,并展示不同颜色. 本文介绍了默认设置的缺陷,以及需要用到的基础知识,最后介绍了更改命令行提示符格 ...
随机推荐
- 重识linux-ntp时间服务器搭建
1 安装 yum install ntp 2 启动 service ntpd start 3 配置文件 /etc/ntp.conf 4 查看是否有报错 tail /var/log/message 5 ...
- hive表命名规范 源码规则
tablename 进来前已经把"`","."等过滤掉了,所以就是单词字符喽 \w搞定 \w包含_ 哈哈 规范就是 a-z A-Z 0-9 _ 也就是传说中的单 ...
- 高程三 BOM 读书笔记
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http ...
- twisted reactor分析
调用reactor.run(),就会调用到mainloop函数,从而调用到select或epoll,监控fd的读写. posixbase.py: def listenTCP(self, port, f ...
- idea 未实现接口红线提示,重复代码波浪线提示,自动换行,控制台输出内容自动换行
01,Could not autowire. No beans of 'UserMapper' type found 01.1,问题描述,通过反射动态实现的接口在调用时会出现以上提示,常见的如 ORM ...
- Kali 局域网 DNS 劫持
<一> 所需工具 1: Kali-linux-2017 2: ettercap 0.8.2 3: web 服务器, 这里以 node 为例 <二> 原理 1: DNS劫持 ...
- leetcode1020
class Solution(object): def __init__(self): self.cons = 0 self.S = list() def dfs(self,m,n,v,A): whi ...
- python中Strip()函数的用法
Python strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列. 注意:该方法只能删除开头或是结尾的字符,不能删除中间部分的字符. str.strip([chars]) ...
- 使用Docker搭建Tomcat运行环境
1 准备宿主系统 准备一个 CentOS 7操作系统,具体要求如下: 必须是 64 位操作系统 建议内核在 3.8 以上 通过以下命令查看您的 CentOS 内核: # uname -r 2 安装Do ...
- node 开始深入
一起学nodejs 讲师: matthew vscode+nodejs4.6 http://list.youku.com/albumlist/show/id_27966955.html?spm=a2h ...