A smart contract or wallet on the blockchain would hold a tokenized version of the security. In this way, folks could leave their tokens on a centralized brokerage if they chose to, or take custody of their shares by transferring the shares to a crypto wallet that they own the keys to.