func (cert *Certificate) AddAsTrustedRoot(prompt string) error {
	tempFileName, err := cert.WriteToTempFile()
	defer os.Remove(tempFileName)
	if err != nil {
		return fmt.Errorf("Unable to create temp file: %s", err)
	}
	nssdb, err := getUserNssdb()
	if err != nil {
		return err
	}
	cmd := exec.Command("certutil", "-d", nssdb, "-A", "-t", "C,,", "-n", cert.X509().Subject.CommonName, "-i", tempFileName)
	out, err := cmd.CombinedOutput()
	if err != nil {
		return fmt.Errorf("Unable to run certutil command: %s\n%s", err, out)
	} else {
		return nil
	}
}
AddAsTrustedRoot adds the certificate to the user's trust store as a trusted
root CA.
Note - on Linux, this assumes the user is using Chrome.
package keyman
import (
	"fmt"
	"os"
	"os/exec"
	"os/user"
)
func DeleteTrustedRootByName(commonName string, prompt string) error {
	nssdb, err := getUserNssdb()
	if err != nil {
		return err
	}
	cmd := exec.Command("certutil", "-d", nssdb, "-D", "-n", commonName)
	out, err := cmd.CombinedOutput()
	if err != nil {
		return fmt.Errorf("Unable to run certutil command: %s\n%s", err, out)
	}
	return nil
}