+ * Method: provisionTrustCertChain1
+ * Signature: (Lorg/iotivity/base/OcSecureResource/provisionTrustCertChain1;)V
+ */
+ JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_provisionTrustCertChain1
+(JNIEnv *env, jobject thiz, jint type, jint credId, jobject jListener)
+{
+ LOGD("OcSecureResource_provisionTrustCertChain1");
+#if defined(__WITH_X509__) || defined(__WITH_TLS__)
+ if (!jListener)
+ {
+ ThrowOcException(OC_STACK_INVALID_PARAM, "provisionTrustCertChainListener cannot be null");
+ return;
+ }
+
+ JniOcSecureResource *secureResource = JniOcSecureResource::getJniOcSecureResourcePtr(env, thiz);
+ if (!secureResource)
+ {
+ return;
+ }
+
+ try
+ {
+ OCStackResult result = secureResource->provisionTrustCertChain(env, type, credId,
+ jListener);
+ if (OC_STACK_OK != result)
+ {
+ ThrowOcException(result, "OcSecureResource_provisionTrustCertChain1");
+ return;
+ }
+ }
+ catch (OCException& e)
+ {
+ LOGE("%s", e.reason().c_str());
+ ThrowOcException(e.code(), e.reason().c_str());
+ }
+#else
+ ThrowOcException(OC_STACK_INVALID_PARAM, "WITH_TLS not enabled");
+ return;
+#endif // __WITH_X509__ || __WITH_TLS__
+}
+
+/*
+ * Class: org_iotivity_base_OcSecureResource