add helper methods to detect if RSA and ECC have been compiled in
parent
2bcf367507
commit
7859729c36
|
@ -159,6 +159,26 @@ JNIEXPORT jboolean JNICALL Java_com_wolfssl_WolfSSL_TLSv1Enabled
|
|||
#endif
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_com_wolfssl_WolfSSL_EccEnabled
|
||||
(JNIEnv* jenv, jclass jcl)
|
||||
{
|
||||
#ifdef HAVE_ECC
|
||||
return JNI_TRUE;
|
||||
#else
|
||||
return JNI_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_com_wolfssl_WolfSSL_RsaEnabled
|
||||
(JNIEnv* jenv, jclass jcl)
|
||||
{
|
||||
#ifndef NO_RSA
|
||||
return JNI_TRUE;
|
||||
#else
|
||||
return JNI_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_com_wolfssl_WolfSSL_SSLv3_1ServerMethod
|
||||
(JNIEnv* jenv, jclass jcl)
|
||||
{
|
||||
|
|
|
@ -295,6 +295,22 @@ JNIEXPORT jint JNICALL Java_com_wolfssl_WolfSSL_getBulkCipherAlgorithmEnumRABBIT
|
|||
JNIEXPORT jboolean JNICALL Java_com_wolfssl_WolfSSL_TLSv1Enabled
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: com_wolfssl_WolfSSL
|
||||
* Method: EccEnabled
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_com_wolfssl_WolfSSL_EccEnabled
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: com_wolfssl_WolfSSL
|
||||
* Method: RsaEnabled
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_com_wolfssl_WolfSSL_RsaEnabled
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: com_wolfssl_WolfSSL
|
||||
* Method: SSLv3_ServerMethod
|
||||
|
|
|
@ -310,7 +310,7 @@ public class WolfSSL {
|
|||
System.load(libPath);
|
||||
}
|
||||
|
||||
/* ---------------- native SSL/TLS version functions ---------------- */
|
||||
/* --------------- native feature detection functions --------------- */
|
||||
|
||||
/**
|
||||
* Tests if TLS 1.0 has been compiled into the native wolfSSL library.
|
||||
|
@ -321,6 +321,22 @@ public class WolfSSL {
|
|||
*/
|
||||
public static native boolean TLSv1Enabled();
|
||||
|
||||
/**
|
||||
* Tests if ECC support has been compiled into the native wolfSSL library.
|
||||
*
|
||||
* @return 1 if enabled, otherwise 0 if not compiled in.
|
||||
*/
|
||||
public static native boolean EccEnabled();
|
||||
|
||||
/**
|
||||
* Tests if RSA support has been compiled into the native wolfSSL library.
|
||||
*
|
||||
* @return 1 if enabled, otherwise 0 if not compiled in.
|
||||
*/
|
||||
public static native boolean RsaEnabled();
|
||||
|
||||
/* ---------------- native SSL/TLS version functions ---------------- */
|
||||
|
||||
/**
|
||||
* Indicates that the application is a server and will only support the
|
||||
* SSL 3.0 protocol.
|
||||
|
|
Loading…
Reference in New Issue