-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
brew: add age and associated shortcuts
- Loading branch information
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
% Encryption | ||
|
||
# Encrypt a file with age for an ssh public key from 1Password | ||
|
||
age --encrypt --recipient '<op_ssh_key_public_key_text>' <file> | ||
|
||
# Decrypt a file with age for an ssh private key from 1Password | ||
|
||
age --decrypt -i <(op item get <op_ssh_key> --format json | jq -r '.fields[] | select(.id == "private_key") | .value') <file> | ||
|
||
# Output an ssh public key from 1password | ||
|
||
op item get <op_ssh_key> --format json | jq -r '.fields[] | select(.id == "public_key") | .value' | ||
|
||
$ op_ssh_key: op item list --categories "SSH Key" | tail -n +2 --- --map "cut -d ' ' -f1" | ||
$ op_ssh_key_public_key_text: op item get <op_ssh_key> --format json | jq -r '.fields[] | select(.id == "public_key") | .value' | ||
$ file: fd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters