code: func (s *Signatory) ClearSign(chartpath string) (string, error) {
  	if s.Entity == nil {
  		return "", errors.New("private key not found")
  	} else if s.Entity.PrivateKey == nil {
  		return "", errors.New("provided key is not a private key")
  	}
  
  	if fi, err := os.Stat(chartpath); err != nil {
  		return "", err
  	} else if fi.IsDir() {
  		return "", errors.New("cannot sign a directory")
  	}
  
  	out := bytes.NewBuffer(nil)
  
  	b, err := messageBlock(chartpath)
  	if err != nil {
  		return "", nil
  	}
  
  	// Sign the buffer
  	w, err := clearsign.Encode(out, s.Entity.PrivateKey, &defaultPGPConfig)
  	if err != nil {
  		return "", err
  	}
  	_, err = io.Copy(w, b)
  	w.Close()
  	return out.String(), err
  }
docs: // ClearSign signs a chart with the given key.
  //
  // This takes the path to a chart archive file and a key, and it returns a clear signature.
  //
  // The Signatory must have a valid Entity.PrivateKey for this to work. If it does
  // not, an error will be returned.