GitHub - vec715/cfgprofiles: Structs and helpers for working with Apple Configuration Profiles in go · GitHub
Skip to content

About

Structs and helpers for working with Apple Configuration Profiles in go

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

Structs and helpers for working with Apple Configuration Profiles in go.

Package cfgprofiles provides structs and helpers for working with Apple Configuration Profiles in go.

Go Reference

Note: marshaling and unmarshaling are dependent on the https://github.com/groob/plist package.

Example unmarshaling (parsing):

b, _ := ioutil.ReadFile("profile.mobileconfig")
p := &cfgprofiles.Profile{}
_ := plist.Unmarshal(b, p)
fmt.Println(p.PayloadIdentifier)
// returns: "com.my.profile.id"

Example marshaling:

p := cfgprofiles.NewProfile("com.my.profile.id")
pld := cfgprofiles.NewCertificatePKCS1Payload("com.my.profile.id.payload")
cert, _ := x509.ParseCertificate(certBytes)
pld.PayloadContent = cert.Raw
p.AddPayload(pld)
b, _ := plist.Marshal(p)
fmt.Println(string(b))
// returns "<?xml version="1.0" encod [...] <key>PayloadContent</key><data>MIIEPjCCAy [...]"

About

Structs and helpers for working with Apple Configuration Profiles in go

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages