Documentation ¶
Overview ¶
Package cryptoutil contains crypto-related helpers and utilities.
Index ¶
- func DecodePEMCertificate(pemData []byte) (*x509.Certificate, error)
- func PEMCertificate(derBytes []byte) []byte
- func TopicFromCert(cert *x509.Certificate) (string, error)
- func TopicFromPEMCert(pemCert []byte) (string, error)
- func VerifyMdmSignature(header string, body []byte) (*x509.Certificate, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePEMCertificate ¶
func DecodePEMCertificate(pemData []byte) (*x509.Certificate, error)
DecodePEMCertificate returns an X509 certificate from a PEM-encoded certificate provided in pemData.
func PEMCertificate ¶
PEMCertificate returns derBytes encoded as a PEM block
func TopicFromCert ¶
func TopicFromCert(cert *x509.Certificate) (string, error)
TopicFromCert extracts the APNs Topic (UserID OID) from cert.
func TopicFromPEMCert ¶
TopicFromPEMCert extracts the APNs Topic from a PEM-encoded cert.
func VerifyMdmSignature ¶
func VerifyMdmSignature(header string, body []byte) (*x509.Certificate, error)
VerifyMdmSignature verifies an Apple MDM "Mdm-Signature" header and returns the signing certificate.
See https://developer.apple.com/documentation/devicemanagement/implementing_device_management/managing_certificates_for_mdm_servers_and_devices section "Pass an Identity Certificate Through a Proxy."
Types ¶
This section is empty.