The same in its own degree must be asserted of the Church, in as far as she is the general help to salvation. Therefore, that one may obtain eternal salvation, it is not always required that he be incorporated into the Church actually as a member, but it necessary that at least he be united to her by desire and longing.
However, this desire need not always be explicit, as it is in catechumens; but when person is involved in invincible ignorance, God accepts also an implicit desire, so called because it is included in that good disposition of soul whereby a person wishes his will to be conformed to the will of God.
…
But it must not be thought that any kind of desire of entering the Church suffices that one may be saved. It is necessary that the desire by which one is related to the Church be animated by perfect charity. Nor can an implicit desire produce its effect, unless a person has supernatural faith: “For he who comes to God must believe that God exists and is a rewarder of those who seek Him” (Hebrew 11:6). The Council of Trent declares (Session VI, chap 8): Faith is the beginning of a man’s salvation, the foundation and root of all justification, without which it is impossible to please God and attain to the fellowship of His children" (Denzinger, n. 80l).