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

Method InstallCA

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

Source from the content-addressed store, hash-verified

89}
90
91func (s *Java) InstallCA(ca *CA) (bool, error) {
92 s.init()
93
94 if s.keytoolPath == "" {
95 return false, Error{
96 Op: OpInstall,
97 Warning: ErrNoKeytool,
98 }
99 }
100
101 args := []string{
102 "-importcert", "-noprompt",
103 "-keystore", s.cacertsPath,
104 "-storepass", s.StorePass,
105 "-file", ca.FilePath,
106 "-alias", ca.UniqueName,
107 }
108
109 if out, err := s.execKeytool(s.SysFS.Command(s.keytoolPath, args...)); err != nil {
110 return false, fatalCmdErr(err, "keytool -importcert", out)
111 }
112 return true, nil
113}
114
115func (s *Java) UninstallCA(ca *CA) (bool, error) {
116 s.init()

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