2013-12-18 08:57:07 -07:00
|
|
|
// Copyright 2013 The Go Authors. All rights reserved.
|
2011-10-13 11:59:13 -06:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2015-02-17 13:17:46 -07:00
|
|
|
//go:generate go run root_darwin_arm_gen.go -output root_darwin_arm.go
|
|
|
|
|
2012-03-07 11:12:35 -07:00
|
|
|
package x509
|
2011-10-13 11:59:13 -06:00
|
|
|
|
2013-12-18 08:57:07 -07:00
|
|
|
import "os/exec"
|
2011-10-13 11:59:13 -06:00
|
|
|
|
2012-03-07 11:12:35 -07:00
|
|
|
func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2013-12-18 08:57:07 -07: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
|
2011-10-13 11:59:13 -06:00
|
|
|
}
|
|
|
|
|
2013-12-18 08:57:07 -07:00
|
|
|
roots := NewCertPool()
|
|
|
|
roots.AppendCertsFromPEM(data)
|
|
|
|
return roots, nil
|
2011-10-13 11:59:13 -06:00
|
|
|
}
|