mirror of
https://github.com/drduh/YubiKey-Guide.git
synced 2025-05-18 11:07:10 +02:00
print configured id/key attributes
This commit is contained in:
parent
4fe4b8c157
commit
1064d2e742
1 changed files with 18 additions and 12 deletions
|
@ -21,19 +21,15 @@ get_id_label () {
|
||||||
printf "YubiKey User <yubikey@example.domain>"
|
printf "YubiKey User <yubikey@example.domain>"
|
||||||
}
|
}
|
||||||
|
|
||||||
export GNUPGHOME="$(get_temp_dir)"
|
get_key_type () {
|
||||||
|
# Returns key type and size.
|
||||||
|
printf "rsa2048"
|
||||||
|
}
|
||||||
|
|
||||||
cd "$GNUPGHOME"
|
get_key_expiration () {
|
||||||
|
# Returns key expiration date.
|
||||||
printf "set temp dir (path=%s)\n" "$(pwd)"
|
printf "2027-05-01"
|
||||||
|
}
|
||||||
export IDENTITY="$(get_id_label)"
|
|
||||||
|
|
||||||
printf "set id (label=%s)\n" "$IDENTITY"
|
|
||||||
|
|
||||||
export KEY_TYPE="rsa4096"
|
|
||||||
|
|
||||||
export KEY_EXPIRATION="2027-05-01"
|
|
||||||
|
|
||||||
get_pass () {
|
get_pass () {
|
||||||
# Returns random passphrase.
|
# Returns random passphrase.
|
||||||
|
@ -44,6 +40,16 @@ get_pass () {
|
||||||
head -c ${PASS_LENGTH:-29}
|
head -c ${PASS_LENGTH:-29}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export GNUPGHOME="$(get_temp_dir)"
|
||||||
|
cd "$GNUPGHOME"
|
||||||
|
printf "set temp dir (path='%s')\n" "$(pwd)"
|
||||||
|
|
||||||
|
export IDENTITY="$(get_id_label)"
|
||||||
|
export KEY_TYPE="$(get_key_type)"
|
||||||
|
export KEY_EXPIRATION="$(get_key_expiration)"
|
||||||
|
printf "set id (label='%s', type='%s', expire='%s')\n" \
|
||||||
|
"$IDENTITY" "$KEY_TYPE" "$KEY_EXPIRATION"
|
||||||
|
|
||||||
export CERTIFY_PASS="$(get_pass)"
|
export CERTIFY_PASS="$(get_pass)"
|
||||||
|
|
||||||
gen_key_certify () {
|
gen_key_certify () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue