예제 #1
0
// 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
}
예제 #2
0
파일: store.go 프로젝트: Paher/go-cryptoapi
// 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
}
예제 #3
0
// 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
}
예제 #4
0
파일: store.go 프로젝트: Paher/go-cryptoapi
// 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
}