"bech32" should be "age_pubkey".
validateInput() {
# Desc: Validates Input
# Usage: validateInput [str input] [str input type]
validateInput() {
# Desc: Validates Input
# Usage: validateInput [str input] [str input type]
# Input: arg1: string to validate
# arg2: string specifying input type (ex:"ssh_pubkey")
# Output: return code 0: if input string matched specified string type
# Input: arg1: string to validate
# arg2: string specifying input type (ex:"ssh_pubkey")
# Output: return code 0: if input string matched specified string type
## age_pubkey
### Check for age1[:bech32:]
## age_pubkey
### Check for age1[:bech32:]
- if [[ "$argType" = "bech32" ]]; then
+ if [[ "$argType" = "age_pubkey" ]]; then
if [[ "$argInput" =~ ^age1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]*$ ]]; then
return 0; fi; fi
if [[ "$argInput" =~ ^age1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]*$ ]]; then
return 0; fi; fi
testKey3="";
testKey4="age1c3s6huz6en6jh40cem0erc0m2un2ry85my0t0ujj4a5cu8gzkysq9l39e4";
keyTypeA="ssh_pubkey";
testKey3="";
testKey4="age1c3s6huz6en6jh40cem0erc0m2un2ry85my0t0ujj4a5cu8gzkysq9l39e4";
keyTypeA="ssh_pubkey";
if validateInput "$testKey1" "$keyTypeA"; then echo "$testKey1 looks like a valid $keyTypeA."; else echo "$testKey1 doesn't look like a valid $keyTypeA."; fi
if validateInput "$testKey2" "$keyTypeA"; then echo "$testKey2 looks like a valid $keyTypeA."; else echo "$testKey2 doesn't look like a valid $keyTypeA."; fi
if validateInput "$testKey3" "$keyTypeA"; then echo "$testKey3 looks like a valid $keyTypeA."; else echo "$testKey3 doesn't look like a valid $keyTypeA."; fi
if validateInput "$testKey1" "$keyTypeA"; then echo "$testKey1 looks like a valid $keyTypeA."; else echo "$testKey1 doesn't look like a valid $keyTypeA."; fi
if validateInput "$testKey2" "$keyTypeA"; then echo "$testKey2 looks like a valid $keyTypeA."; else echo "$testKey2 doesn't look like a valid $keyTypeA."; fi
if validateInput "$testKey3" "$keyTypeA"; then echo "$testKey3 looks like a valid $keyTypeA."; else echo "$testKey3 doesn't look like a valid $keyTypeA."; fi