Maybe.
But more likely a house door lock. It is a latch ‘made to lock and spring’. There is a draw-back knob on the inside, with a slide to snib the latch withdrawn, or block use of the key outside.
The bolt can also be shot out a second throw which genuinely deadlocks it. Having a solid bridge ward, it dates from post 1818, probably from the Victorian house-building boom from mid-century onwards, possibly as late as 1914 but likely, last quarter of 19C.
Cleaned, and complete with a (usually repro) staple, period ironmongers sell these for [usually somewhat over £100], so not too bad a price.
Originally it was black japanned, then probably painted with whatever paint was on the door. Today, matt black looks good. That rusting is only superficial. Commonly the hollow know is badly dented.