#!/bin/bash # Desc: Checks if string is an age-compatible public key string checkAgePubkey() { # Desc: Checks if string is an age-compatible pubkey # Usage: checkAgePubkey [str pubkey] # Version: 0.1.0 # Input: arg1: string # Output: return code 0: string is age-compatible pubkey # return code 1: string is NOT an age-compatible pubkey # Depends: age (v0.1.0-beta2; https://github.com/FiloSottile/age/releases/tag/v1.0.0-beta2 ) argPubkey="$1"; if echo "test" | age -a -r "$argPubkey" 1>/dev/null; then return 0; else return 1; fi; } # Check age pubkey