Files
micromdm/cmd/mdmctl/sign.go
Kory Prince 5495df8c15 implement mdmctl apply app -sign-identity (#785)
* implement mdmctl apply app -sign-identity

* update go-cpio-odc for macOS compatibility

* update go-cpio-odc for windows compatibility

* update go-cpio-odc to satisfy builder
2022-04-14 13:09:47 -04:00

34 lines
708 B
Go

//go:build !darwin
// +build !darwin
package main
import (
"fmt"
"os"
goerrors "errors"
macospkg "github.com/korylprince/go-macos-pkg"
"github.com/pkg/errors"
)
func signPackage(path, outpath, developerID string) error {
fmt.Println("[WARNING] package signing with -sign only implemented on macOS. Use -sign-identity instead")
return nil
}
func checkSignature(pkgpath string) (bool, error) {
buf, err := os.ReadFile(pkgpath)
if err != nil {
return false, errors.Wrap(err, "reading package")
}
if err = macospkg.VerifyPkg(buf); err != nil {
if goerrors.Is(err, macospkg.ErrNotSigned) {
return false, nil
}
return false, errors.Wrap(err, "verifying package")
}
return true, nil
}