func (c *Cert) SaveSecret(filename string) error {
	cFilename := C.CString(filename)
	defer C.free(unsafe.Pointer(cFilename))
	rc := C.zcert_save_secret(c.zcertT, cFilename)
	if rc == C.int(-1) {
		return fmt.Errorf("SaveSecret error")
	}
	return nil
}
SaveSecret saves the secret key to a file
package goczmq
import "C"
import (
	"fmt"
	"os"
	"unsafe"
)
type Cert struct {
	zcertT *C.struct__zcert_t
}
func NewCert() *Cert {
	return &Cert{
		zcertT: C.zcert_new(),
	}
}
func NewCertFromKeys(public []byte, secret []byte) (*Cert, error) {
	if len(public) != 32 {
		return nil, fmt.Errorf("invalid public key")
	}
	if len(secret) != 32 {
		return nil, fmt.Errorf("invalid private key")
	}
	return &Cert{
		zcertT: C.zcert_new_from(
			(*C.byte)(unsafe.Pointer(&public[0])),
			(*C.byte)(unsafe.Pointer(&secret[0]))),
	}, nil
}
func NewCertFromFile(filename string) (*Cert, error) {
	_, err := os.Stat(filename)
	if os.IsNotExist(err) {
		return nil, ErrCertNotFound
	}
	cFilename := C.CString(filename)
	defer C.free(unsafe.Pointer(cFilename))
	cert := C.zcert_load(cFilename)
	return &Cert{
		zcertT: cert,
	}, nil
}
func (c *Cert) SetMeta(key string, value string) {
	cKey := C.CString(key)
	defer C.free(unsafe.Pointer(cKey))
	cValue := C.CString(value)
	defer C.free(unsafe.Pointer(cValue))
	C.Set_meta(c.zcertT, cKey, cValue)
}
func (c *Cert) Meta(key string) string {
	cKey := C.CString(key)
	defer C.free(unsafe.Pointer(cKey))
	val := C.zcert_meta(c.zcertT, cKey)
	return C.GoString(val)
}
func (c *Cert) PublicText() string {
	val := C.zcert_public_txt(c.zcertT)
	return C.GoString(val)
}
func (c *Cert) Apply(s *Sock) {
	handle := C.zsock_resolve(unsafe.Pointer(s.zsockT))
	C.zsock_set_curve_secretkey_bin(handle, C.zcert_secret_key(c.zcertT))
	C.zsock_set_curve_publickey_bin(handle, C.zcert_public_key(c.zcertT))
}
func (c *Cert) Dup() *Cert {
	return &Cert{
		zcertT: C.zcert_dup(c.zcertT),
	}
}
func (c *Cert) Equal(compare *Cert) bool {
	check := C.zcert_eq(c.zcertT, compare.zcertT)
	if check == C.bool(true) {
		return true
	}
	return false
}
func (c *Cert) Print() {
	C.zcert_print(c.zcertT)
}
func (c *Cert) SavePublic(filename string) error {
	cFilename := C.CString(filename)
	defer C.free(unsafe.Pointer(cFilename))
	rc := C.zcert_save_public(c.zcertT, cFilename)
	if rc == C.int(-1) {
		return fmt.Errorf("SavePublic error")
	}
	return nil
}