I ran into a problem with return jobject.
I have class:
class KeyPair {
std::vector<BYTE> _publicKey;
std::vector<BYTE> _privateKey;
public:
void SetKeys(std::vector<BYTE> publicKey, std::vector<BYTE> privateKey)
{
_publicKey = publicKey;
_privateKey = privateKey;
};
};
and function:
JNIEXPORT jobject JNICALL function(JNIEnv *env, jobject)
{
//some code
KeyPair keyPair;
keyPair.SetKeys(pub, priv);
return keyPair;//error
}
How can i return keyPair as jobjecct?