@@ -92,20 +92,6 @@ func SecTrustSettingsCopyCertificates(domain SecTrustSettingsDomain) (certArray
92
92
}
93
93
func x509_SecTrustSettingsCopyCertificates_trampoline ()
94
94
95
- const kSecFormatX509Cert int32 = 9
96
-
97
- //go:cgo_import_dynamic x509_SecItemExport SecItemExport "/System/Library/Frameworks/Security.framework/Versions/A/Security"
98
-
99
- func SecItemExport (cert CFRef ) (data CFRef , err error ) {
100
- ret := syscall (abi .FuncPCABI0 (x509_SecItemExport_trampoline ), uintptr (cert ), uintptr (kSecFormatX509Cert ),
101
- 0 /* flags */ , 0 /* keyParams */ , uintptr (unsafe .Pointer (& data )), 0 )
102
- if ret != 0 {
103
- return 0 , OSStatus {"SecItemExport" , int32 (ret )}
104
- }
105
- return data , nil
106
- }
107
- func x509_SecItemExport_trampoline ()
108
-
109
95
const errSecItemNotFound = - 25300
110
96
111
97
//go:cgo_import_dynamic x509_SecTrustSettingsCopyTrustSettings SecTrustSettingsCopyTrustSettings "/System/Library/Frameworks/Security.framework/Versions/A/Security"
@@ -233,3 +219,16 @@ func SecTrustGetCertificateAtIndex(trustObj CFRef, i int) CFRef {
233
219
return CFRef (ret )
234
220
}
235
221
func x509_SecTrustGetCertificateAtIndex_trampoline ()
222
+
223
+ //go:cgo_import_dynamic x509_SecCertificateCopyData SecCertificateCopyData "/System/Library/Frameworks/Security.framework/Versions/A/Security"
224
+
225
+ func SecCertificateCopyData (cert CFRef ) ([]byte , error ) {
226
+ ret := syscall (abi .FuncPCABI0 (x509_SecCertificateCopyData_trampoline ), uintptr (cert ), 0 , 0 , 0 , 0 , 0 )
227
+ if ret == 0 {
228
+ return nil , errors .New ("x509: invalid certificate object" )
229
+ }
230
+ b := CFDataToSlice (CFRef (ret ))
231
+ CFRelease (CFRef (ret ))
232
+ return b , nil
233
+ }
234
+ func x509_SecCertificateCopyData_trampoline ()
0 commit comments