code: func ParseKeyFile(location string) ([]byte, error) {
  	r, err := regexp.Compile(`<Data>(.+)</Data>`)
  	if err != nil {
  		return nil, err
  	}
  	file, err := os.Open(location)
  	if err != nil {
  		return nil, err
  	}
  	var data []byte
  	if data, err = ioutil.ReadAll(file); err != nil {
  		return nil, err
  	}
  	if r.Match(data) { //If keyfile is in xml form, extract key data
  		base := r.FindSubmatch(data)[1]
  		data = make([]byte, base64.StdEncoding.DecodedLen(len(base)))
  		if _, err := base64.StdEncoding.Decode(data, base); err != nil {
  			return nil, err
  		}
  	}
  	// Slice necessary due to padding at the end of the hash
  	return data[:32], nil
  }
docs: // ParseKeyFile returns the hashed key from a key file at the path specified by location, parsing xml if needed