Where is the snippet of code in ipfs to check/verify swarm key for private ipfs network?

I would understand more about how swarm key is verified and checked for ipfs private network. Where is code which performs swarm key checking and verification? Thanks.

Swarm keys are used for symmetric encryption using salsa20. This is done with what is called a “go-libp2p-pnet” implementation which wraps all connection traffic and is implemented here: https://github.com/libp2p/go-libp2p-pnet

hector, thank you very much!