// CertStore method returns handle to certificate store in certain CSP context func (c Ctx) CertStore(name string) (res CertStore, err error) { cName := charPtr(name) defer freePtr(cName) res.hStore = C.openStoreSystem(c.hProv, cName) if res.hStore == nil { err = getErr("Error getting system cert store") return } return }
// CertStore method returns handle to certificate store in certain CSP context func (c *Ctx) CertStore(name string) (*CertStore, error) { var res CertStore cName := charPtr(name) defer freePtr(cName) res.hStore = C.openStoreSystem(c.hProv, cName) if res.hStore == C.HCERTSTORE(nil) { return &res, getErr("Error getting system cert store") } return &res, nil }
// SystemStore returns handle to certificate store with certain name, using // default system cryptoprovider func SystemStore(name string) (res CertStore, err error) { cName := C.CString(name) defer C.free(unsafe.Pointer(cName)) res.hStore = C.openStoreSystem(C.HCRYPTPROV(0), (*C.CHAR)(cName)) if res.hStore == C.HCERTSTORE(nil) { err = getErr("Error getting system cert store") return } return }
// SystemStore returns handle to certificate store with certain name, using // default system cryptoprovider func SystemStore(name string) (*CertStore, error) { var res CertStore cName := unsafe.Pointer(C.CString(name)) defer C.free(cName) res.hStore = C.openStoreSystem(C.HCRYPTPROV(0), (*C.CHAR)(cName)) if res.hStore == C.HCERTSTORE(nil) { return &res, getErr("Error getting system cert store") } return &res, nil }