|
|
@ -833,8 +833,8 @@ Java_com_xypower_mpapp_MicroPhotoService_querySecVersion(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" JNIEXPORT jboolean JNICALL
|
|
|
|
extern "C" JNIEXPORT jboolean JNICALL
|
|
|
|
Java_com_xypower_mpapp_MicroPhotoService_requestCert(
|
|
|
|
Java_com_xypower_mpapp_MicroPhotoService_genCertRequest(
|
|
|
|
JNIEnv* env, jclass cls, jint type, jint index, jstring subject, jstring outputPath) {
|
|
|
|
JNIEnv* env, jclass cls, jint index, jint type, jstring subject, jstring outputPath) {
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef USING_NRSEC
|
|
|
|
#ifdef USING_NRSEC
|
|
|
|
if (env->GetStringUTFLength(subject) <=0 || env->GetStringUTFLength(outputPath) <=0)
|
|
|
|
if (env->GetStringUTFLength(subject) <=0 || env->GetStringUTFLength(outputPath) <=0)
|
|
|
@ -853,8 +853,7 @@ Java_com_xypower_mpapp_MicroPhotoService_requestCert(
|
|
|
|
uint16_t len = 0;
|
|
|
|
uint16_t len = 0;
|
|
|
|
const char* subjectStr = env->GetStringUTFChars(subject, 0);
|
|
|
|
const char* subjectStr = env->GetStringUTFChars(subject, 0);
|
|
|
|
|
|
|
|
|
|
|
|
std::string titleStr(subjectStr);
|
|
|
|
bool res = nrsec.SM2cert(type, index, MakeString(subjectStr), output, &len) == 0;
|
|
|
|
bool res = nrsec.SM2cert(type, index, titleStr, output, &len) == 0;
|
|
|
|
|
|
|
|
nrsec.Close();
|
|
|
|
nrsec.Close();
|
|
|
|
env->ReleaseStringUTFChars(subject, subjectStr);
|
|
|
|
env->ReleaseStringUTFChars(subject, subjectStr);
|
|
|
|
if (!res)
|
|
|
|
if (!res)
|
|
|
|