code: func Security(name string, tpt interface{}) Option {
  	stpt, err := config.SecurityConstructor(tpt)
  	err = traceError(err, 1)
  	return func(cfg *Config) error {
  		if err != nil {
  			return err
  		}
  		if cfg.Insecure {
  			return fmt.Errorf("cannot use security transports with an insecure libp2p configuration")
  		}
  		cfg.SecurityTransports = append(cfg.SecurityTransports, config.MsSecC{SecC: stpt, ID: name})
  		return nil
  	}
  }
docs: // Security configures libp2p to use the given security transport (or transport
  // constructor).
  //
  // Name is the protocol name.
  //
  // The transport can be a constructed security.Transport or a function taking
  // any subset of this libp2p node's:
  // * Public key
  // * Private key
  // * Peer ID
  // * Host
  // * Network
  // * Peerstore