validateInput() {
# Desc: Validates Input
# Usage: validateInput [str input] [str input type]
- # Version: 0.2.0
+ # Version: 0.2.1
# 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:]
- if [[ "$argType" = "bech32" ]]; then
+ if [[ "$argType" = "age_pubkey" ]]; then
if [[ "$argInput" =~ ^age1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]*$ ]]; then
return 0; fi; fi
testKey3="";
testKey4="age1c3s6huz6en6jh40cem0erc0m2un2ry85my0t0ujj4a5cu8gzkysq9l39e4";
keyTypeA="ssh_pubkey";
-keyTypeB="bech32";
+keyTypeB="age_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