def gpg_key(value):
    """
    test if value points to a known gpg key
    and return that key as a gpg key object.
    """
    try:
        return crypto.get_key(value)
    except GPGProblem as e:
        raise ValidateError(str(e))