Secret : Add public key.

This commit is contained in:
Dmitry Voronin 2024-04-09 16:30:33 +03:00
parent f30d0d230f
commit 0047396214
5 changed files with 173 additions and 3 deletions

View file

@ -7,7 +7,7 @@
pull.rebase = true;
push.autoSetupRemote = true;
rebase.autoStash = true;
user.signingkey = secret.crypto.sign.key;
user.signingkey = builtins.readFile secret.crypto.sign.key;
gpg.format = secret.crypto.sign.format;
};
};

View file

@ -0,0 +1,59 @@
{ ... }: {
text = ''
# Encrypt files to myself.
# Usage: encrypt <FILES>
function encrypt() {
local IFS=$'\n'
local targets=(''${@})
[[ "''${targets}" = "" ]] && targets=($(_ls_file))
process() {
gpg --encrypt --armor --recipient hi@voronind.com --output "''${target}.enc" "''${target}"
}
_iterate_targets process ''${targets[@]}
}
# Decrypt files to myself.
# Usage: decrypt <FILES>
function decrypt() {
local IFS=$'\n'
local targets=(''${@})
[[ "''${targets}" = "" ]] && targets=($(_ls_file))
process() {
gpg --decrypt --output "''${target%.enc}" "''${target}"
}
_iterate_targets process ''${targets[@]}
}
# Sign a file.
# Usage: sign <FILES>
function sign() {
local IFS=$'\n'
local targets=(''${@})
[[ "''${targets}" = "" ]] && targets=($(_ls_file))
process() {
gpg --detach-sig --armor --output "''${target}.sig" "''${target}"
}
_iterate_targets process ''${targets[@]}
}
# Verify a signature.
# Usage: verify <FILES>
function verify() {
local IFS=$'\n'
local targets=(''${@})
[[ "''${targets}" = "" ]] && targets=(*.sig)
process() {
gpg --verify "''${target}"
}
_iterate_targets process ''${targets[@]}
}
'';
}

View file

@ -6,15 +6,16 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFgiYKFkMfiGOZCZIk+O7LtaoF6A3cHEFCqaPwXOM4rR root@work"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBL5NAm8S97EtfB/7DPf5Xl3Cqi3PlSO1V0m7fknNzz root@laptop"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIL2LI1iFDZC223aWqBVz9yusfB/XrRwsBKiL5warIF/ nix-on-droid@phone"
(builtins.readFile ./secret/public/Ssh.key)
];
crypto = {
sign = {
format = "ssh";
key = "";
key = ./secret/public/Ssh.key;
};
publicKeys = [
./secret/public/Gpg.key
];
};
}

109
part/secret/public/Gpg.key Normal file
View file

@ -0,0 +1,109 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGYVMQYBEAC4Tuq21ukErFBcauH64NGUvByEdxyCUFXbb7/O895bRS/Oy+HZ
n1LjhUTBQSxXpgDlj8KMHv9RtpxuU7DZ76NrcJLhK2jKel97d9WIBRFE/2GaoW5+
L4bDj36Xyr6bby0DD4ltK2SkA206ulkALa3/+36SRy1NRxYO92dxpsaaYPHKyVr2
TRktA9gj+KuzSTwmEn5IiKAbnGfAJ52P5bKqP3gLg9vgzygVwxidwgG+HbGj+/f8
Si7h6u25A2iTtK0yMs+9U/Q1DM4fT8gZ621h+Ls4tLmpLJDuDih78+faoMcxf+Pw
o7s4ce/GEMXfsUYAnpqhS6J98MIfe4lnH/t+BCqwZjcgSiAX6vcEVmcUxTLteQpH
xhxkqQ8QbRXLCSYaR5GaZ3LMZ/IW8Zj+/C2PXbvLBAtdvcresFJ2jCaTbvx/31p4
BLPFboJa1zhTXwt+BLv+iXDOPtaAVN9NwC7ffW3Qre6vw07ZuFFM8FzAs0VuJmCz
ktAupWthZOj/22zRYQ+70jCrgrnvhIwkWs3R7hNDFzHurDn+igILWwwWiTbGYssi
YXs5Apo3nF9kfSB65+rTuAiyTCPXugYodA+TGkxH1Q8U+1AjBQELgBDLlJQDBkf6
dmfgDFbEpt7OR3qF13gHM9WOCGlw9YGUq6YgyT1nvc+KqSpbyZHRduYNGwARAQAB
tCBEbWl0cnkgVm9yb25pbiA8aGlAdm9yb25pbmQuY29tPokCUQQTAQgAOxYhBDJB
/a2Cp+ItQnn0BZE/MmeSeC4cBQJmFTEGAhsDBQsJCAcCAiICBhUKCQgLAgQWAgMB
Ah4HAheAAAoJEJE/MmeSeC4csV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