From The Book of Common Worship’s Times and Seasons (p.58).
These antiphons, or refrains, all beginning ‘O …’, were sung before and after the Magnificat at Vespers, according to the Roman use, on the seven days preceding Christmas Eve (17–23 December). They are addressed to God, calling for him to come as teacher and deliverer, with a tapestry of scriptural titles and pictures that describe his saving work in Christ. In the medieval rite of Salisbury Cathedral that was widely followed in England before the Reformation, the antiphons began on 16 December and there was an additional antiphon (‘O Virgin of virgins’) on 23 December; this is reflected in the Calendar of The Book of Common Prayer, where 16 December is designated O Sapientia (O Wisdom). The Common Worship Calendar has adopted the more widely used form. It is not known when and by whom the antiphons were composed, but they were already in use by the eighth century.
20 December – O Clavis David
O Key of David and sceptre of the House of Israel; you open and no one can shut; you shut and no one can open: Come and lead the prisoners from the prison house, those who dwell in darkness and the shadow of death.
–cf Isaiah 22.22; 42.7