$ brew tap filippo.io/age https://filippo.io/age $ brew install age
生成密钥对
1 2
$ age-keygen -o key.txt Public key: age1st0m5a72gtlk3pz3fnvy08huq8d9llut2vnjwxzkeudejkc0fs9s6dj9ev
使用公钥对数据进行加密
1
$ sops -a age1st0m5a72gtlk3pz3fnvy08huq8d9llut2vnjwxzkeudejkc0fs9s6dj9ev -e secrets.yaml > secrets_enc.yaml
错误处理
在解密时报如下错误
1 2 3 4 5 6 7 8 9
vagrant@ubuntu-focal:~$ sops a2.yaml Failed to get the data key required to decrypt the SOPS file.
Group 0: FAILED FA21E3EDC58BA05535435756543DF0088828FFCC: FAILED - | could not decrypt data key with PGP key: | golang.org/x/crypto/openpgp error: Could not load secring: | open /home/vagrant/.gnupg/secring.gpg: no such file or | directory; GPG binary error: exit status 2