code: func (ks *fileBasedKeyStore) Init(pwd []byte, path string, readOnly bool) error {
  	// Validate inputs
  	// pwd can be nil
  
  	if len(path) == 0 {
  		return errors.New("An invalid KeyStore path provided. Path cannot be an empty string.")
  	}
  
  	ks.m.Lock()
  	defer ks.m.Unlock()
  
  	if ks.isOpen {
  		return errors.New("KeyStore already initilized.")
  	}
  
  	ks.path = path
  	ks.pwd = utils.Clone(pwd)
  
  	err := ks.createKeyStoreIfNotExists()
  	if err != nil {
  		return err
  	}
  
  	err = ks.openKeyStore()
  	if err != nil {
  		return err
  	}
  
  	ks.readOnly = readOnly
  
  	return nil
  }
docs: // Init initializes this KeyStore with a password, a path to a folder
  // where the keys are stored and a read only flag.
  // Each key is stored in a separated file whose name contains the key's SKI
  // and flags to identity the key's type.
  // If the KeyStore is initialized with a password, this password
  // is used to encrypt and decrypt the files storing the keys.
  // The pwd can be nil for non-encrypted KeyStores. If an encrypted
  // key-store is initialized without a password, then retrieving keys from the
  // KeyStore will fail.
  // A KeyStore can be read only to avoid the overwriting of keys.