예제 #1
0
파일: cert.go 프로젝트: vonwenm/goczmq
// Save saves the public and secret key to filename and filename_secret
func (c *Cert) Save(filename string) error {
	rc := C.zcert_save(c.zcertT, C.CString(filename))
	if rc == C.int(-1) {
		return fmt.Errorf("SavePublic: error")
	}
	return nil
}
예제 #2
0
파일: cert.go 프로젝트: roger2000hk/goczmq
// Save saves the public and secret key to filename and filename_secret
func (c *Cert) Save(filename string) error {
	cFilename := C.CString(filename)
	defer C.free(unsafe.Pointer(cFilename))

	rc := C.zcert_save(c.zcertT, cFilename)
	if rc == C.int(-1) {
		return fmt.Errorf("SavePublic: error")
	}
	return nil
}