I would like to change
Cipher cipher = Cipher.getInstance("DES");
into cpp code in jni.How to do it?
JNIEnv *jni; //Comes from somewhere
jclass cl = jni->FindClass("javax/crypto/Cipher");
jmethodID MID = jni->GetStaticMethodID(cl, "getInstance", "(Ljava/lang/String)Ljavax/crypto/Cipher;");
jstring s = jni->NewStringUTF("DES");
jobject cipher = jni->CallStaticObjectMethod(cl, MID, s);
That's omitting error handling.