macOS 存取keychain 密码

macOS 通过 Keychain 存取密码 - 简书

Mac之Security工具使用总结_fswy的博客-CSDN博客

 Security是Mac系统中钥匙串和安全模块的命令行管理工具,(图形化工具为Keychain Access.app)。钥匙串(Keychain)实质上就是一个用于存放证书、密钥、密码等安全认证实体的仓库,在计算机中保存为一个.keychain的文件,默认存放在以下目录中(使用这几个目录中的钥匙串时不需要写路径,直接用文件名即可,Security工具会自动搜索):

  ~/Library/Keychains/
  /Library/Keychains/
 -/Network/Library/Keychains/

Keychain 是一个保存密码、证书等私密文件的一个库;

create keychain

delete keychain

unlock keychain

lock keychain

set-keychain-password

password 是保存在keychain里的一个元素。

add-generic-password

delete-generic-password

find-generic-password

 

> security add-generic-password --help

Usage: add-generic-password [-a account] [-s service] [-w password] [options...] [-A|-T appPath] [keychain]

    -a  Specify account name (required)

    -c  Specify item creator (optional four-character code)

    -C  Specify item type (optional four-character code)

    -D  Specify kind (default is "application password")

    -G  Specify generic attribute (optional)

    -j  Specify comment string (optional)

    -l  Specify label (if omitted, service name is used as default label)

    -s  Specify service name (required)

    -p  Specify password to be added (legacy option, equivalent to -w)

    -w  Specify password to be added

    -X  Specify password data to be added as a hexadecimal string

    -A  Allow any application to access this item without warning (insecure, not recommended!)

    -T  Specify an application which may access this item (multiple -T options are allowed)

    -U  Update item if it already exists (if omitted, the item cannot already exist)

By default, the application which creates an item is trusted to access its data without warning.

You can remove this default access by explicitly specifying an empty app pathname: -T ""

If no keychain is specified, the password is added to the default keychain.

Use of the -p or -w options is insecure. Specify -w as the last option to be prompted.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值