package fic import ( "os/exec" ) func convOutput(in []byte, err error) (string, error) { return string(in), err } func GenerateCA() (string, error) { // Call the script and return its standard and error output cmd := exec.Command("./CA.sh", "-newca") return convOutput(cmd.CombinedOutput()) } func GenerateCRL() (string, error) { cmd := exec.Command("./CA.sh", "-gencrl") return convOutput(cmd.CombinedOutput()) } func (t Team) GenerateCert() (string, error) { cmd := exec.Command("./CA.sh", "-newclient", t.Name) return convOutput(cmd.CombinedOutput()) } func (t Team) RevokeCert() (string, error) { cmd := exec.Command("./CA.sh", "-revoke", t.Name) return convOutput(cmd.CombinedOutput()) }