I realise that this is not a specific question yet I think it fleshes out what the Catechism teaches over the course of many of its excellent questions and answers.
As an important detail, yes our Lord had founded his church before being killed by Annas and Caiphas, and the pope of such church was st. peter, but like our Lord had founded the new sacrifice on Holy Thursday, which he also gave to the twelve apostles his priesthood to make that sacrifice of a New Testament, that priesthood and that sacrifice he taught them by command was in virtue and in potency in time until Jesus, as the Christ, had shed his blood and died on the cross, per his Father, to effect the graces of that sacrifice and act of redemption.
St. Matthew - "And when the hour was come, he sat down, and the twelve apostles with him. And he said to them: With desire I have desired to eat this pasch with you, before I suffer. For I say to you, that from this time I will not eat it, till it be fulfilled in the kingdom of God. And having taken the chalice, he gave thanks, and said: Take, and divide it among you: For I say to you, that I will not drink of the fruit of the vine, till the kingdom of God come. And taking bread, he gave thanks, and brake; and gave to them, saying: This is my body, which is given for you. Do this for a commemoration of me.* In like manner the chalice also, after he had supped, saying: This is the chalice, the new testament in my blood, which shall be shed for you."
Shall be shed is a verb in the future tense. Christ needed to spill his blood and die in the following hours on good friday to effect the legality of the new testament sacrifice. Thus Christ's preparation for his church, its priesthood, and its sacrifice was in potency until he shed his blood and died.
(*Do this for a commemoration of me: This sacrifice and sacrament is to be continued in the church, to the end of the world, to show forth the death of Christ, until he comes.)
So too was the church our Lord had founded before his death that was in virtue and potency until our Lord, the new Adam, had shed his blood and died on the cross until the soldier's spear, which was prophesied, had pierced his heart spilling out blood and water that the infant church was born from his side. In addition, we are told that by the power of God, the old testament was officially null and void after our Lord's sacrifice and death that the huge veil in the temple was rent in two, from top to bottom, which is impossible in nature. It was 40 cubits (60 feet high) and about 4 inches thick, another true sign to the pharisees that our Lord was the Christ and God. St. Matthew - “And when Jesus had cried out again in a loud voice, he gave up his spirit. At that moment the curtain of the temple was torn in two from top to bottom”. It is thus that Jesus and his sacrifice had then entered into the Holy of Holies once and forever as a pleasing and acceptable sacrifice to his father.
Therefore, the authority and high priesthood of Annas and Caiphas was still a legitimate authority before our Lord had died and were still right up until the death of our Lord. So, when Our Lord Jesus Christ recognized Caiphas as the priest and pontiff, He was recognizing him as the true pontiff of the legitimate authority to the seat of Moses.
The transition of legitimate authority to the new testament happened when our Lord effected his sacrifice and his death on the cross and immediately the veil of the old testament was rent in two.