()
| 30 | } |
| 31 | |
| 32 | func (s *Java) init() { |
| 33 | s.inito.Do(func() { |
| 34 | keytoolCommand := "keytool" |
| 35 | if runtime.GOOS == "windows" { |
| 36 | keytoolCommand = "keytool.exe" |
| 37 | } |
| 38 | |
| 39 | if keytoolPath := filepath.Join(s.JavaHomeDir, "bin", keytoolCommand); binaryExists(s.SysFS, keytoolPath) { |
| 40 | s.keytoolPath = keytoolPath |
| 41 | } |
| 42 | |
| 43 | if cacertsPath := filepath.Join(s.JavaHomeDir, "lib", "security", "cacerts"); pathExists(s.SysFS, cacertsPath) { |
| 44 | s.cacertsPath = cacertsPath |
| 45 | } |
| 46 | |
| 47 | if cacertsPath := filepath.Join(s.JavaHomeDir, "jre", "lib", "security", "cacerts"); pathExists(s.SysFS, cacertsPath) { |
| 48 | s.cacertsPath = cacertsPath |
| 49 | } |
| 50 | }) |
| 51 | } |
| 52 | |
| 53 | func (s *Java) CheckCA(ca *CA) (bool, error) { |
| 54 | s.init() |
no test coverage detected