JNI object retrieval on C++ side

T

Tim Wong

I am new with using JNI and haven't found any code snippets for what I
am trying to do....please bear with me.

-I have a java method (in java class TestClass) returning an object:

public Object getPublicKey(){
KeyPair kp;
....
....
PublicKey thePubKey = kp.getPublic();
return ( (Object)thePubKey );
}

-I have a C++ function trying to use JNI to run this like so:
(assumptions...I have the JNI MethodID of getPublicKey.)

bool CTestClass::getKey(){
???
}

Assuming I have the c++ pointers setup for an instance of "TestClass"
and a methodID for "getPublicKey()", What would be the proper way to
call getPublicKey() from C++? Once I get the Object returned from
getPublicKey(), how do I access it's methods and public members?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top