2015-08-28 15:33:40 +00:00
|
|
|
// Copyright 2013 The Go Authors. All rights reserved.
|
2012-03-27 23:13:14 +00:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2017-04-10 11:32:00 +00:00
|
|
|
//go:generate go run root_darwin_arm_gen.go -output root_darwin_armx.go
|
|
|
|
|
2014-09-21 17:33:12 +00:00
|
|
|
package x509
|
2012-03-27 23:13:14 +00:00
|
|
|
|
2015-08-28 15:33:40 +00:00
|
|
|
import "os/exec"
|
2012-03-27 23:13:14 +00:00
|
|
|
|
2014-09-21 17:33:12 +00:00
|
|
|
func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2015-08-28 15:33:40 +00:00
|
|
|
func execSecurityRoots() (*CertPool, error) {
|
|
|
|
cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", "/System/Library/Keychains/SystemRootCertificates.keychain")
|
|
|
|
data, err := cmd.Output()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
2012-03-27 23:13:14 +00:00
|
|
|
}
|
|
|
|
|
2015-08-28 15:33:40 +00:00
|
|
|
roots := NewCertPool()
|
|
|
|
roots.AppendCertsFromPEM(data)
|
|
|
|
return roots, nil
|
2012-03-27 23:13:14 +00:00
|
|
|
}
|