def add_password_env(env, password, password_type='plain'):
    """Add password variable into given environment

    :type env: dict()
    :type password: str
    :type password_type: str
    """
    if password is not None:
        if password_type != 'plain':
            env['PSA_CRYPTED_PASSWORD'] = password
        else:
            env['PSA_PASSWORD'] = password
    return env
