本文主要讲述JNI在实际项目中的使用方法,主要目的是记录,不做太多说明,代码如下:
1、CMakeLists.txt
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
project("device-authentication")
INCLUDE_DIRECTORIES(/usr/include ../../include ../../net ../../net/mbedtls/include ../../smalgo/sms4/include)
SET(my_src_crypto
../../net/mbedtls/library/aes.c
../../net/mbedtls/library/aesni.c
../../net/mbedtls/library/base64.c
../../net/mbedtls/library/rsa.c
../../net/mbedtls/library/rsa_internal.c
../../net/mbedtls/library/entropy.c
../../net/mbedtls/library/entropy_poll.c
../../net/mbedtls/library/bignum.c
../../net/mbedtls/library/sha1.c
../../net/mbedtls/library/sha256.c
../../net/mbedtls/library