Home | History | Annotate | Download | only in x509
      1 // Copyright 2013 The Go Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style
      3 // license that can be found in the LICENSE file.
      4 
      5 //go:generate go run root_darwin_arm_gen.go -output root_darwin_armx.go
      6 
      7 package x509
      8 
      9 import "os/exec"
     10 
     11 func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) {
     12 	return nil, nil
     13 }
     14 
     15 func execSecurityRoots() (*CertPool, error) {
     16 	cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", "/System/Library/Keychains/SystemRootCertificates.keychain")
     17 	data, err := cmd.Output()
     18 	if err != nil {
     19 		return nil, err
     20 	}
     21 
     22 	roots := NewCertPool()
     23 	roots.AppendCertsFromPEM(data)
     24 	return roots, nil
     25 }
     26