According to the ProtEvangelium of James it was done by a lady called Salome after she had been told by Marys midwife that she remained a virgin after birth. Salome went to the stable to check. So there were two witnesses according to the book.
Chp 19:18 - 20:11
And the midwife departed from the cave and met Salome and said to her, "Salome, Salome, I have to describe this new miracle for you. A virgin has given birth, although her body does not allow it." (19) And Salome said, "As the Lord my God lives, unless I insert my finger and investigate her, I will not believe that a virgin has given birth." CHAPTER 20 (1) And the midwife went in and said, "Mary, position yourself, for not a small test concerning you is about to take place." (2) When Mary heard these things, she positioned herself. And Salome inserted her finger into her body. (3) And Salome cried out and said, "Woe for my lawlessness and the unbelief that made me test the living God. Look, my hand is falling away from me and being consumed in fire." (5) And Salome dropped to her knees before the Lord, saying, "God of Abraham and Isaac and Jacob, (6) do not expose me to the children of Israel, but give me back to the poor. (7) For you know, Lord, that I have performed service and received my wage from you." (8) Suddenly, an angel of the Lord appeared, saying to her, "Salome, Salome, the Lord of all has heard your entreaty. (9) Stretch out your hand to the child and lift him up and he will be salvation and joy for you." (10) And Salome went to the child and lifted him up, saying, "I worship him because he has been born a king to Israel." (11) And at once Salome was healed and left the cave justified.
But this sounds the more fanciful part of the account and a little contrived like it was answering the question you raised rather than giving an account of what actually happened. I am not convinced of the necessity of perpetual virginity, can see no good biblical grounds to accept it and it neither adds nor detracts from my respect for Mary. I am inclined to accept the assumption but on a provisional basis, it is biblically possible and there is a strong early tradition for it. But again with Immaculate conception really do not see the necessity of it and can find no strong case for it. Even in the Gospel of James which is a pro Mary as you can get the doctrine is not obvious in the text.