func verifyChart(path string, keyring string) error {
	// For now, error out if it's not a tar file.
	if fi, err := os.Stat(path); err != nil {
		return err
	} else if fi.IsDir() {
		return errors.New("unpacked charts cannot be verified")
	} else if !isTar(path) {
		return errors.New("chart must be a tgz file")
	}

	provfile := path + ".prov"
	if _, err := os.Stat(provfile); err != nil {
		return fmt.Errorf("could not load provenance file %s: %s", provfile, err)
	}

	sig, err := provenance.NewFromKeyring(keyring, "")
	if err != nil {
		return fmt.Errorf("failed to load keyring: %s", err)
	}
	ver, err := sig.Verify(path, provfile)
	if flagDebug {
		for name := range ver.SignedBy.Identities {
			fmt.Printf("Signed by %q\n", name)
		}
	}
	return err
}
// verifyChart takes a path to a chart archive and a keyring, and verifies the chart.
//
// It assumes that a chart archive file is accompanied by a provenance file whose
// name is the archive file name plus the ".prov" extension.
verifyChart takes a path to a chart archive and a keyring, and verifies the chart.

It assumes that a chart archive file is accompanied by a provenance file whose
name is the archive file name plus the ".prov" extension.
// verifyChart takes a path to a chart archive and a keyring and verifies the chart . // // It assumes that a chart archive file is accompanied by a provenance file whose // name is the archive file name plus the " . prov " extension .
func verifyChart(path string, keyring string) error {
	if fi, err := os.Stat(path); err != nil {
		return err
	} else if fi.IsDir() {
		return errors.New("unpacked charts cannot be verified")
	} else if !isTar(path) {
		return errors.New("chart must be a tgz file")
	}
	provfile := path + ".prov"
	if _, err := os.Stat(provfile); err != nil {
		return fmt.Errorf("could not load provenance file %s: %s", provfile, err)
	}
	sig, err := provenance.NewFromKeyring(keyring, "")
	if err != nil {
		return fmt.Errorf("failed to load keyring: %s", err)
	}
	ver, err := sig.Verify(path, provfile)
	if flagDebug {
		for name := range ver.SignedBy.Identities {
			fmt.Printf("Signed by %q\n", name)
		}
	}
	return err
}
func verifyChart ( path string , keyring string ) error { if fi , err := os . Stat ( path ) ; err != nil { return err } else if fi . IsDir ( ) { return errors . New ( " " ) } else if ! isTar ( path ) { return errors . New ( " " ) } provfile := path + " " if _ , err := os . Stat ( provfile ) ; err != nil { return fmt . Errorf ( " " , provfile , err ) } sig , err := provenance . NewFromKeyring ( keyring , " " ) if err != nil { return fmt . Errorf ( " " , err ) } ver , err := sig . Verify ( path , provfile ) if flagDebug { for name := range ver . SignedBy . Identities { fmt . Printf ( " \n " , name ) } } return err }
verifyChart takes a path to a chart archive and a keyring, and verifies the chart.
verifyChart takes a path to a chart archive and a keyring and verifies the chart .
// For now, error out if it's not a tar file.