code: func InitCrypto(mspMgrConfigDir, localMSPID, localMSPType string) error {
  	var err error
  	// Check whether msp folder exists
  	fi, err := os.Stat(mspMgrConfigDir)
  	if os.IsNotExist(err) || !fi.IsDir() {
  		// No need to try to load MSP from folder which is not available
  		return errors.Errorf("cannot init crypto, folder \"%s\" does not exist", mspMgrConfigDir)
  	}
  	// Check whether localMSPID exists
  	if localMSPID == "" {
  		return errors.New("the local MSP must have an ID")
  	}
  
  	// Init the BCCSP
  	SetBCCSPKeystorePath()
  	var bccspConfig *factory.FactoryOpts
  	err = viperutil.EnhancedExactUnmarshalKey("peer.BCCSP", &bccspConfig)
  	if err != nil {
  		return errors.WithMessage(err, "could not parse YAML config")
  	}
  
  	err = mspmgmt.LoadLocalMspWithType(mspMgrConfigDir, bccspConfig, localMSPID, localMSPType)
  	if err != nil {
  		return errors.WithMessage(err, fmt.Sprintf("error when setting up MSP of type %s from directory %s", localMSPType, mspMgrConfigDir))
  	}
  
  	return nil
  }
docs: // InitCrypto initializes crypto for this peer