Add macros for signing things with SSH keys
This commit is contained in:
parent
55ac191f08
commit
4cf7f6f8bb
@ -1 +1,4 @@
|
||||
evan@ewpratten.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMbNW3x0Cx04MybxQo5FptZhdjiFJjKITtq67KqrDXAN+jepJwdIG6TUJzuJddztuYIsvPAoQPpiQVSPyC8y51Y=
|
||||
evan@ewpratten.com sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIAkdmKF1cYQTW7cfK7TYC5iVBsAg5g3SRJqlqo2NixHdAAAABHNzaDo=
|
||||
evan@ewpratten.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGBaSKoWYuR43fxRPy31P/X/2Ri2hYUZTjKiLBRDoa1F
|
||||
evan@ewpratten.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGEqeWe+pVp3rTsmHr9v5Qcb+niHXihJxwVKcc7p6EXz
|
||||
|
@ -95,3 +95,25 @@ genpass() {
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# Sign a file with an SSH key
|
||||
ssh-sign(){
|
||||
if [ $# != 2 ]; then
|
||||
echo "Usage: ssh-sign <key_file> <file>"
|
||||
else
|
||||
if [ -f $2 ]; then
|
||||
cat $2 | ssh-keygen -Y sign -f $1 -n file -
|
||||
else
|
||||
>&2 echo "File not found: $2"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Verify a file, using the ~/.ssh/allowed_signers file
|
||||
ssh-verify(){
|
||||
if [ $# != 3 ]; then
|
||||
echo "Usage: ssh-verify <author> <sigfile> <file>"
|
||||
else
|
||||
ssh-keygen -Y verify -f ~/.ssh/allowed_signers -n file -I $1 -s $2 < $3
|
||||
fi
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user