MCPcopy Create free account
hub / github.com/anchordotdev/cli / UninstallCA

Method UninstallCA

truststore/java.go:115–139  ·  view source on GitHub ↗
(ca *CA)

Source from the content-addressed store, hash-verified

113}
114
115func (s *Java) UninstallCA(ca *CA) (bool, error) {
116 s.init()
117
118 if s.keytoolPath == "" {
119 return false, Error{
120 Op: OpUninstall,
121 Warning: ErrNoKeytool,
122 }
123 }
124
125 args := []string{
126 "-delete",
127 "-alias", ca.UniqueName,
128 "-keystore", s.cacertsPath,
129 "-storepass", s.StorePass,
130 }
131 out, err := s.execKeytool(s.SysFS.Command(s.keytoolPath, args...))
132 if bytes.Contains(out, []byte("does not exist")) {
133 return false, nil // cert didn't exist
134 }
135 if err != nil {
136 return false, fatalCmdErr(err, "keytool -delete", out)
137 }
138 return true, nil
139}
140
141// execKeytool will execute a "keytool" command and if needed re-execute
142// the command with commandWithSudo to work around file permissions.

Callers

nothing calls this directly

Calls 4

initMethod · 0.95
execKeytoolMethod · 0.95
fatalCmdErrFunction · 0.85
CommandMethod · 0.65

Tested by

no test coverage detected