macOS
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package macOS provides cgo-less wrappers for Core Foundation andSecurity.framework, similarly to how package syscall provides access tolibSystem.dylib.
Index¶
- Constants
- func CFArrayAppendValue(array CFRef, val CFRef)
- func CFArrayGetCount(array CFRef) int
- func CFDataGetBytePtr(data CFRef) uintptr
- func CFDataGetLength(data CFRef) int
- func CFDataToSlice(data CFRef) []byte
- func CFEqual(a, b CFRef) bool
- func CFErrorGetCode(errRef CFRef) int
- func CFNumberGetValue(num CFRef) (int32, error)
- func CFRelease(ref CFRef)
- func CFStringToString(ref CFRef) string
- func ReleaseCFArray(array CFRef)
- func SecCertificateCopyData(cert CFRef) ([]byte, error)
- func SecTrustEvaluateWithError(trustObj CFRef) (int, error)
- func SecTrustSetVerifyDate(trustObj CFRef, dateRef CFRef) error
- type CFRef
- func BytesToCFData(b []byte) CFRef
- func CFArrayCreateMutable() CFRef
- func CFArrayGetValueAtIndex(array CFRef, index int) CFRef
- func CFDateCreate(seconds float64) CFRef
- func CFDictionaryGetValueIfPresent(dict CFRef, key CFString) (value CFRef, ok bool)
- func CFErrorCopyDescription(errRef CFRef) CFRef
- func CFStringCreateExternalRepresentation(strRef CFRef) (CFRef, error)
- func SecCertificateCreateWithData(b []byte) (CFRef, error)
- func SecPolicyCreateSSL(name string) (CFRef, error)
- func SecTrustCopyCertificateChain(trustObj CFRef) (CFRef, error)
- func SecTrustCreateWithCertificates(certs CFRef, policies CFRef) (CFRef, error)
- func SecTrustEvaluate(trustObj CFRef) (CFRef, error)
- func TimeToCFDateRef(t time.Time) CFRef
- type CFString
- type OSStatus
Constants¶
const (// various macOS error codes that can be returned from// SecTrustEvaluateWithError that we can map to Go cert// verification error types.ErrSecCertificateExpired = -67818ErrSecHostNameMismatch = -67602ErrSecNotTrusted = -67843)
Variables¶
This section is empty.
Functions¶
funcCFArrayAppendValue¶added ingo1.18
funcCFArrayGetCount¶
funcCFDataGetLength¶
funcCFDataToSlice¶
CFDataToSlice returns a copy of the contents of data as a bytes slice.
funcCFErrorGetCode¶added ingo1.18.10
funcCFStringToString¶added ingo1.18
CFStringToString returns a Go string representation of the passedin CFString, or an empty string if it's invalid.
funcReleaseCFArray¶added ingo1.18
func ReleaseCFArray(arrayCFRef)
ReleaseCFArray iterates through an array, releasing its contents, and thenreleases the array itself. This is necessary because we cannot, easily, set theCFArrayCallBacks argument when creating CFArrays.
funcSecCertificateCopyData¶added ingo1.18
funcSecTrustEvaluateWithError¶added ingo1.18
funcSecTrustSetVerifyDate¶added ingo1.18
Types¶
typeCFRef¶
type CFRefuintptr
CFRef is an opaque reference to a Core Foundation object. It is a pointer,but to memory not owned by Go, so not an unsafe.Pointer.
funcBytesToCFData¶added ingo1.18
funcCFArrayCreateMutable¶added ingo1.18
func CFArrayCreateMutable()CFRef
funcCFDateCreate¶added ingo1.18
funcCFErrorCopyDescription¶added ingo1.18
funcCFStringCreateExternalRepresentation¶added ingo1.18
funcSecCertificateCreateWithData¶added ingo1.18
funcSecPolicyCreateSSL¶added ingo1.18
funcSecTrustCopyCertificateChain¶added ingo1.25.0
funcSecTrustCreateWithCertificates¶added ingo1.18
funcSecTrustEvaluate¶added ingo1.18
funcTimeToCFDateRef¶added ingo1.18
TimeToCFDateRef converts a time.Time into an apple CFDateRef.
typeCFString¶
type CFStringCFRef
funcStringToCFString¶
StringToCFString returns a copy of the UTF-8 contents of s as a new CFString.