Skip to content

Structs and helpers for working with Apple Configuration Profiles in go

License

Notifications You must be signed in to change notification settings

jessepeterson/cfgprofiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages