func SignWithKey()

in macos/wrapper.go [161:181]


func SignWithKey(label, tag string, hash, data []byte) ([]byte, error) {
	cl, ct := C.CString(label), C.CString(tag)
	cd := C.CBytes(data)
	var ch unsafe.Pointer
	if len(hash) != 0 {
		ch = C.CBytes(hash)
		defer C.free(unsafe.Pointer(ch))
	}
	clen := C.size_t(len(data))
	w := C.wrapSignWithKey(cl, ct, ch, cd, clen)
	C.free(unsafe.Pointer(cd))
	C.free(unsafe.Pointer(cl))
	C.free(unsafe.Pointer(ct))

	res, err := unwrap(w)
	if err != nil {
		return res, err
	}

	return res, nil
}