def aead_filename(aead_dir, key_handle, public_id):
    """
    Return the filename of the AEAD for this public_id,
    and create any missing directorys.
    """
    parts = [aead_dir, key_handle] + pyhsm.util.group(public_id, 2)
    path = os.path.join(*parts)

    if not os.path.isdir(path):
        os.makedirs(path)

    return os.path.join(path, public_id)
Return the filename of the AEAD for this public_id,
    and create any missing directorys.