def _validate_message(message):
    """Ensure the message is correctly representable by GPG."""
    if not message or not message.endswith(b'\n'):
        raise ValueError(
            'Invalid message supplied. The message must be non-empty and must end in a newline character, otherwise GPG may not be able to sign and recover it correctly.'
            )
