code: func (a *Agent) loadKeyringFile(keyringFile string) error {
  	// Avoid passing an encryption key and a keyring file at the same time
  	if len(a.agentConf.EncryptKey) > 0 {
  		return fmt.Errorf("Encryption key not allowed while using a keyring")
  	}
  
  	if _, err := os.Stat(keyringFile); err != nil {
  		return err
  	}
  
  	// Read in the keyring file data
  	keyringData, err := ioutil.ReadFile(keyringFile)
  	if err != nil {
  		return fmt.Errorf("Failed to read keyring file: %s", err)
  	}
  
  	// Decode keyring JSON
  	keys := make([]string, 0)
  	if err := json.Unmarshal(keyringData, &keys); err != nil {
  		return fmt.Errorf("Failed to decode keyring file: %s", err)
  	}
  
  	// Decode base64 values
  	keysDecoded := make([][]byte, len(keys))
  	for i, key := range keys {
  		keyBytes, err := base64.StdEncoding.DecodeString(key)
  		if err != nil {
  			return fmt.Errorf("Failed to decode key from keyring: %s", err)
  		}
  		keysDecoded[i] = keyBytes
  	}
  
  	// Guard against empty keyring file
  	if len(keysDecoded) == 0 {
  		return fmt.Errorf("Keyring file contains no keys")
  	}
  
  	// Create the keyring
  	keyring, err := memberlist.NewKeyring(keysDecoded, keysDecoded[0])
  	if err != nil {
  		return fmt.Errorf("Failed to restore keyring: %s", err)
  	}
  	a.conf.MemberlistConfig.Keyring = keyring
  	a.logger.Printf("[INFO] agent: Restored keyring with %d keys from %s",
  		len(keys), keyringFile)
  
  	// Success!
  	return nil
  }
docs: // loadKeyringFile will load a keyring out of a file