Sample Android project, Android Gradle GitHub Action, and gradle build fixes #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains three main things:
IDE/Android
), which can be used as a simple example for adding wolfCrypt JNI/JCE to an Android Studio project. It is also used as the basis for the GitHub Action test.The fixes/refactors made to resolve build warnings include:
WolfCryptDebug.log()
directly since it is a static method@Deprecated
, which now throw exceptions telling users what to replace that usage with. (See section below for specifically deprecated APIs). Deprecating these APIs also has the benefit of us not storing key material in memory at the Java level. When the appropriatesetKey()
/etc method is called we can pass the keying material directly down to native wolfSSL in the JNI call.Deprecated Class Constructors (in package
com.wolfssl.wolfcrypt
):Aes(byte[] key, byte[] iv, int opmode)
-> useAes()
+Aes.setKey(byte[] key, byte[] iv, int opmode)
AesGcm(byte[] key)
-> useAesGcm()
+AesGcm.setKey(byte[] key)
Des3(byte[] key, byte[] iv, int opmode)
-> useDes3()
+Des3.setKey(byte[] key, byte[] iv, int opmode)
Hmac(int type, byte[] key)
-> useHmac()
+Hmac.setKey(int type, byte[] key)
Rsa(byte[] key)
-> useRsa()
+Rsa.decodePrivateKey(byte[] key)
Rsa(byte[] n, byte[] e)
-> useRsa()
+Rsa.decodeRawPublicKey(byte[] n, byte[] e)
Md5(Md5 md5)
-> useMd5.clone()
Sha(Sha sha)
-> useSha.clone()
Sha256(Sha256 sha256)
-> useSha256.clone()
Sha384(Sha384 sha384)
-> useSha384.clone()
Sha512(Sha512 sha512)
-> useSha512.clone()