Repository: wultra/powerauth-crypto
Pull request #389 (2021-12-06 13:07:25)

Prepare release 1.2.0
Merge of changes for the next release from `develop` into `master`.


Patch:
diff --git a/docs/PowerAuth-2021.05.md b/docs/PowerAuth-2021.05.md
index 66f4d749..66dfcfa3 100644
--- a/docs/PowerAuth-2021.05.md
+++ b/docs/PowerAuth-2021.05.md
@@ -4,9 +4,9 @@
 
 For updating to 2021.05, please follow these migration guides:
 
-- [PowerAuth Server - Migration from version 1.1.0 to version 1.1.0](https://github.com/wultra/powerauth-server/blob/develop/docs/PowerAuth-Server-1.1.0.md)
-- [PowerAuth Push Server - Migration from version 1.1.0 to version 1.1.0](https://github.com/wultra/powerauth-push-server/blob/develop/docs/PowerAuth-Push-Server-1.1.0.md)
-- [PowerAuth Web Flow - Migration from version 1.1.0 to version 1.1.0](https://github.com/wultra/powerauth-webflow/blob/develop/docs/Web-Flow-1.1.0.md)
+- [PowerAuth Server - Migration from version 1.0.0 to version 1.1.0](https://github.com/wultra/powerauth-server/blob/develop/docs/PowerAuth-Server-1.1.0.md)
+- [PowerAuth Push Server - Migration from version 1.0.0 to version 1.1.0](https://github.com/wultra/powerauth-push-server/blob/develop/docs/PowerAuth-Push-Server-1.1.0.md)
+- [PowerAuth Web Flow - Migration from version 1.0.0 to version 1.1.0](https://github.com/wultra/powerauth-webflow/blob/develop/docs/Web-Flow-1.1.0.md)
 - [PowerAuth Mobile SDK - Migration from version 1.5.0 to version 1.6.0](https://github.com/wultra/powerauth-mobile-sdk/blob/develop/docs/Migration-from-1.5-to-1.6.md)
 
 ## Components for version 2021.05
@@ -66,4 +66,4 @@ For updating to 2021.05, please follow these migration guides:
 
 ## Known Issues When Updating From Older Versions
 
-_No known issues so far._
\ No newline at end of file
+_No known issues so far._
diff --git a/docs/PowerAuth-2021.11.md b/docs/PowerAuth-2021.11.md
new file mode 100644
index 00000000..d483d3a5
--- /dev/null
+++ b/docs/PowerAuth-2021.11.md
@@ -0,0 +1,69 @@
+# PowerAuth 2021.11
+
+## Migration guides
+
+For updating to 2021.11, please follow these migration guides:
+
+- [PowerAuth Server - Migration from version 1.1.0 to version 1.2.0](https://github.com/wultra/powerauth-server/blob/develop/docs/PowerAuth-Server-1.2.0.md)
+- [PowerAuth Push Server - Migration from version 1.1.0 to version 1.2.0](https://github.com/wultra/powerauth-push-server/blob/develop/docs/PowerAuth-Push-Server-1.2.0.md)
+- [PowerAuth Web Flow - Migration from version 1.1.0 to version 1.2.0](https://github.com/wultra/powerauth-webflow/blob/develop/docs/Web-Flow-1.2.0.md)
+- [PowerAuth Mobile SDK - Migration from version 1.5.0 to version 1.6.0](https://github.com/wultra/powerauth-mobile-sdk/blob/develop/docs/Migration-from-1.5-to-1.6.md)
+
+## Components for version 2021.11
+
+### Back-End Applications
+
+| Component | Application Name | Version | Description |
+|---|---|---|---|
+| PowerAuth Server | `powerauth-java-server.war` | 1.2.0 | Core back-end component for PowerAuth stack. |
+| PowerAuth Admin | `powerauth-admin.war` | 1.2.0 | Administration console for PowerAuth Server. |
+| PowerAuth Push Server | `powerauth-push-server.war` | 1.2.0 | Simple to deploy push server for APNS and FCM. |
+| PowerAuth Web Flow | `powerauth-webflow.war` | 1.2.0 | Central web authentication page. |
+| PowerAuth Next Step | `powerauth-next-step.war` | 1.2.0 | Authorization server used for PowerAuth Web Flow component. |
+| PowerAuth Data Adapter | `powerauth-data-adapter.war` | 1.2.0 | Customization component for PowerAuth Web Flow. |
+| PowerAuth Tpp Engine | `powerauth-tpp-engine.war` | 1.2.0 | Third party provider registry and consent engine. |
+
+### Utilities
+
+| Component | Application Name | Version | Description |
+|---|---|---|---|
+| PowerAuth Command Line Tool | `powerauth-java-cmd.jar` | 1.2.0 | Command line tool for integration testing. |
+
+### Mobile Libraries
+
+| Platform | Package Name | Version | Description |
+|---|---|---|---|
+| iOS | `PowerAuth2` | 1.6.2 | A client library for iOS. |
+| watchOS | `PowerAuth2ForWatch` | 1.6.2 | A limited library for watchOS. |
+| iOS App Extensions | `PowerAuth2ForExtensions` | 1.6.2 | A limited library for iOS App Extensions. |
+| Android | `com.wultra.android.powerauth:powerauth-sdk` | 1.6.2 | A client library for Android. |
+
+### Back-End Integration Libraries
+
+| Component | Library Name |  Version | Description |
+|---|---|---|---|
+| PowerAuth RESTful Model | `powerauth-restful-model.jar` | 1.2.0 | Model classes for request and response objects used in PowerAuth Standard RESTful API. |
+| PowerAuth RESTful API Security for Spring | `powerauth-restful-security-spring.jar` | 1.2.0 | High-level integration libraries for RESTful API security, build for Spring MVC. |
+| PowerAuth SOAP Client for Spring WS | `powerauth-java-client-spring.jar` | 1.2.0 | SOAP service client for PowerAuth Server service, built using Spring WS. |
+| PowerAuth Push Server RESTful Model | `powerauth-push-model.jar` | 1.2.0 | Model classes for request and response objects used in PowerAuth Push Server. |
+| PowerAuth Push Server RESTful Client | `powerauth-push-client.jar` | 1.2.0 | Client implementation that simplifies integration with PowerAuth Push Server service. |
+| PowerAuth Data Adapter RESTful Model | `powerauth-data-adapter-model.jar` | 1.2.0 | Model classes for request and response objects used in PowerAuth Data Adapter component. |
+| PowerAuth Data Adapter Client | `powerauth-data-adapter-client.jar` | 1.2.0 | Client implementation that simplifies integration with PowerAuth Data Adapter custom component. |
+| PowerAuth Next Step RESTful Model | `powerauth-nextstep-model.jar` | 1.2.0 | Model classes for request and response objects used in PowerAuth Next Step service. |
+| PowerAuth Next Step Client | `powerauth-nextstep-client.jar` | 1.2.0 | Client implementation that simplifies integration with PowerAuth Next Step service. |
+| PowerAuth Mobile Token Model | `powerauth-mtoken-model.jar` | 1.2.0 | Model classes for request and response objects used in PowerAuth Mobile Token. |
+
+### Technical Dependencies
+
+| Component | Library Name | Version | Description |
+|---|---|---|---|
+| PowerAuth Cryptography | `powerauth-java-crypto.jar` | 1.2.0 | Core cryptography implementation of the PowerAuth protocol. |
+| PowerAuth HTTP Utilities | `powerauth-java-http.jar` | 1.2.0 | Utilities used for binding PowerAuth cryptography to HTTP technology. |
+| PowerAuth Command-Line Tool Library | `powerauth-java-cmd-lib.jar` | 1.2.0 | Library used for implementation of the PowerAuth Command-Line Tool app, useful for unit testing. |
+| PowerAuth RESTful Security Base Support | `powerauth-restful-security-base.jar` | 1.2.0 | Base classes for RESTful API security. |
+| Wultra Java Networking Objects | `rest-model-base.jar` | 1.4.0 | Base classes for RESTful API networking, shared across all Wultra back-end projects. |
+| Wultra REST Client | `rest-client-base.jar` | 1.4.0 | Base RESTful client implementation, shared across all Wultra back-end projects. |
+
+## Known Issues When Updating From Older Versions
+
+_No known issues so far._
\ No newline at end of file
diff --git a/docs/Releases.md b/docs/Releases.md
index bbaece16..81a4ab36 100644
--- a/docs/Releases.md
+++ b/docs/Releases.md
@@ -12,6 +12,8 @@ In order to consolidate the information about the current versions, we have intr
 
 ## List of Releases
 
+- [PowerAuth 2021.11](./PowerAuth-2021.11.md)
+- [PowerAuth 2021.05](./PowerAuth-2021.05.md)
 - [PowerAuth 2020.11](./PowerAuth-2020.11.md)
 - [PowerAuth 2020.05](./PowerAuth-2020.05.md)
 - [PowerAuth 2019.11](./PowerAuth-2019.11.md)
@@ -19,4 +21,4 @@ In order to consolidate the information about the current versions, we have intr
 - [PowerAuth 2018.12](./PowerAuth-2018.12.md)
 - [PowerAuth 2018.06](./PowerAuth-2018.06.md)
 - [PowerAuth 2018.03](./PowerAuth-2018.03.md)
-- [PowerAuth 2017.11](./PowerAuth-2017.11.md)
\ No newline at end of file
+- [PowerAuth 2017.11](./PowerAuth-2017.11.md)
diff --git a/pom.xml b/pom.xml
index ad9ce2be..b2876bf4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
 
     <groupId>io.getlime.security</groupId>
     <artifactId>powerauth-crypto-parent</artifactId>
-    <version>1.1.0</version>
+    <version>1.2.0</version>
     <packaging>pom</packaging>
 
     <inceptionYear>2016</inceptionYear>
@@ -136,13 +136,11 @@
             <build>
                 <plugins>
                     <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-gpg-plugin</artifactId>
-                        <version>3.0.1</version>
+                        <groupId>org.kohsuke</groupId>
+                        <artifactId>pgp-maven-plugin</artifactId>
+                        <version>1.1</version>
                         <executions>
                             <execution>
-                                <id>sign-artifacts</id>
-                                <phase>verify</phase>
                                 <goals>
                                     <goal>sign</goal>
                                 </goals>
diff --git a/powerauth-java-crypto/pom.xml b/powerauth-java-crypto/pom.xml
index 735b0aec..44eb3fef 100644
--- a/powerauth-java-crypto/pom.xml
+++ b/powerauth-java-crypto/pom.xml
@@ -21,13 +21,13 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<artifactId>powerauth-java-crypto</artifactId>
-	<version>1.1.0</version>
+	<version>1.2.0</version>
 	<packaging>jar</packaging>
 
 	<parent>
 		<groupId>io.getlime.security</groupId>
 		<artifactId>powerauth-crypto-parent</artifactId>
-		<version>1.1.0</version>
+		<version>1.2.0</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
@@ -35,36 +35,36 @@
 		<dependency>
 			<groupId>com.google.guava</groupId>
 			<artifactId>guava</artifactId>
-			<version>30.1.1-jre</version>
+			<version>31.0.1-jre</version>
 		</dependency>
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-api</artifactId>
-			<version>1.7.30</version>
+			<version>1.7.32</version>
 		</dependency>
 		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<version>4.13.2</version>
+			<groupId>org.junit.jupiter</groupId>
+			<artifactId>junit-jupiter-engine</artifactId>
+			<version>5.7.2</version>
 			<scope>test</scope>
 		</dependency>
 		<dependency>
 			<groupId>com.fasterxml.jackson.core</groupId>
 			<artifactId>jackson-databind</artifactId>
-			<version>2.12.3</version>
+			<version>2.13.0</version>
 			<scope>test</scope>
 		</dependency>
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-simple</artifactId>
-			<version>1.7.30</version>
+			<version>1.7.32</version>
 			<scope>test</scope>
 		</dependency>
 
 		<dependency>
 			<groupId>org.bouncycastle</groupId>
 			<artifactId>bcprov-jdk15on</artifactId>
-			<version>1.68</version>
+			<version>1.69</version>
 			<scope>provided</scope>
 		</dependency>
 	</dependencies>
diff --git a/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/encryptor/ecies/EciesDecryptor.java b/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/encryptor/ecies/EciesDecryptor.java
index 4eb456e0..97936072 100644
--- a/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/encryptor/ecies/EciesDecryptor.java
+++ b/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/encryptor/ecies/EciesDecryptor.java
@@ -24,6 +24,7 @@ import io.getlime.security.powerauth.crypto.lib.model.exception.GenericCryptoExc
 import io.getlime.security.powerauth.crypto.lib.util.AESEncryptionUtils;
 import io.getlime.security.powerauth.crypto.lib.util.HMACHashUtilities;
 import io.getlime.security.powerauth.crypto.lib.util.KeyConvertor;
+import io.getlime.security.powerauth.crypto.lib.util.SideChannelUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -31,7 +32,6 @@ import javax.crypto.SecretKey;
 import java.security.InvalidKeyException;
 import java.security.PrivateKey;
 import java.security.interfaces.ECPrivateKey;
-import java.util.Arrays;
 
 /**
  * Class implementing an ECIES decryptor.
@@ -222,7 +222,7 @@ public class EciesDecryptor {
             // Validate data MAC value
             final byte[] macData = (sharedInfo2 == null ? cryptogram.getEncryptedData() : Bytes.concat(cryptogram.getEncryptedData(), sharedInfo2));
             final byte[] mac = hmac.hash(envelopeKey.getMacKey(), macData);
-            if (!Arrays.equals(mac, cryptogram.getMac())) {
+            if (!SideChannelUtils.constantTimeAreEqual(mac, cryptogram.getMac())) {
                 throw new EciesException("Invalid MAC");
             }
 
diff --git a/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/encryptor/ecies/EciesEncryptor.java b/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/encryptor/ecies/EciesEncryptor.java
index b16125d2..df246231 100644
--- a/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/encryptor/ecies/EciesEncryptor.java
+++ b/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/encryptor/ecies/EciesEncryptor.java
@@ -25,6 +25,7 @@ import io.getlime.security.powerauth.crypto.lib.model.exception.GenericCryptoExc
 import io.getlime.security.powerauth.crypto.lib.util.AESEncryptionUtils;
 import io.getlime.security.powerauth.crypto.lib.util.HMACHashUtilities;
 import io.getlime.security.powerauth.crypto.lib.util.KeyConvertor;
+import io.getlime.security.powerauth.crypto.lib.util.SideChannelUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -32,7 +33,6 @@ import javax.crypto.SecretKey;
 import java.security.InvalidKeyException;
 import java.security.PublicKey;
 import java.security.interfaces.ECPublicKey;
-import java.util.Arrays;
 
 /**
  * Class implementing an ECIES encryptor.
@@ -232,7 +232,7 @@ public class EciesEncryptor {
             // Validate data MAC value
             final byte[] macData = (sharedInfo2 == null ? cryptogram.getEncryptedData() : Bytes.concat(cryptogram.getEncryptedData(), sharedInfo2));
             final byte[] mac = hmac.hash(envelopeKey.getMacKey(), macData);
-            if (!Arrays.equals(mac, cryptogram.getMac())) {
+            if (!SideChannelUtils.constantTimeAreEqual(mac, cryptogram.getMac())) {
                 throw new EciesException("Invalid MAC");
             }
 
diff --git a/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/model/Argon2Hash.java b/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/model/Argon2Hash.java
index f9f3fbe9..34411cff 100644
--- a/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/model/Argon2Hash.java
+++ b/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/model/Argon2Hash.java
@@ -17,6 +17,7 @@
 package io.getlime.security.powerauth.crypto.lib.model;
 
 import com.google.common.io.BaseEncoding;
+import io.getlime.security.powerauth.crypto.lib.util.SideChannelUtils;
 
 import java.io.IOException;
 import java.util.*;
@@ -231,7 +232,7 @@ public class Argon2Hash {
         if (digest == null || other.digest == null) {
             return false;
         }
-        return Arrays.equals(digest, other.digest);
+        return SideChannelUtils.constantTimeAreEqual(digest, other.digest);
     }
 
     /**
diff --git a/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/util/HashBasedCounterUtils.java b/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/util/HashBasedCounterUtils.java
index e4b5f939..97ad29b7 100644
--- a/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/util/HashBasedCounterUtils.java
+++ b/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/util/HashBasedCounterUtils.java
@@ -104,6 +104,6 @@ public class HashBasedCounterUtils {
         // Calculate hash from current hash based counter
         final byte[] expectedCtrDataHash = calculateHashFromHashBasedCounter(expectedCtrData, transportKey);
         // Compare both hashed values
-        return Arrays.equals(expectedCtrDataHash, receivedCtrDataHash);
+        return SideChannelUtils.constantTimeAreEqual(expectedCtrDataHash, receivedCtrDataHash);
     }
 }
diff --git a/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/util/SideChannelUtils.java b/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/util/SideChannelUtils.java
new file mode 100644
index 00000000..148c6350
--- /dev/null
+++ b/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/util/SideChannelUtils.java
@@ -0,0 +1,41 @@
+/*
+ * PowerAuth Crypto Library
+ * Copyright 2021 Wultra s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.getlime.security.powerauth.crypto.lib.util;
+
+import org.bouncycastle.util.Arrays;
+
+/**
+ * Utilities for preventing side channel attacks.
+ *
+ * @author Roman Strobl, roman.strobl@wultra.com
+ */
+public class SideChannelUtils {
+
+    private SideChannelUtils() {
+        
+    }
+
+    /**
+     * Compare two byte arrays in constant time.
+     * @param bytes1 First byte array.
+     * @param bytes2 Second byte array.
+     * @return Whether byte arrays are equal.
+     */
+    public static boolean constantTimeAreEqual(byte[] bytes1, byte[] bytes2) {
+        return Arrays.constantTimeAreEqual(bytes1, bytes2);
+    }
+}
diff --git a/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/util/TokenUtils.java b/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/util/TokenUtils.java
index a51d41f2..dc311f93 100644
--- a/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/util/TokenUtils.java
+++ b/powerauth-java-crypto/src/main/java/io/getlime/security/powerauth/crypto/lib/util/TokenUtils.java
@@ -116,7 +116,7 @@ public class TokenUtils {
      * @throws CryptoProviderException In case cryptography provider is incorrectly initialized.
      */
     public boolean validateTokenDigest(byte[] nonce, byte[] timestamp, byte[] tokenSecret, byte[] tokenDigest) throws GenericCryptoException, CryptoProviderException {
-        return Arrays.equals(computeTokenDigest(nonce, timestamp, tokenSecret), tokenDigest);
+        return SideChannelUtils.constantTimeAreEqual(computeTokenDigest(nonce, timestamp, tokenSecret), tokenDigest);
     }
 
 }
diff --git a/powerauth-java-http/pom.xml b/powerauth-java-http/pom.xml
index 3a1e02cd..6489c46a 100644
--- a/powerauth-java-http/pom.xml
+++ b/powerauth-java-http/pom.xml
@@ -21,7 +21,7 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<artifactId>powerauth-java-http</artifactId>
-	<version>1.1.0</version>
+	<version>1.2.0</version>
 	<name>powerauth-java-http</name>
 	<description>PowerAuth utility module for HTTP support</description>
 	<packaging>jar</packaging>
@@ -29,7 +29,7 @@
 	<parent>
 		<groupId>io.getlime.security</groupId>
 		<artifactId>powerauth-crypto-parent</artifactId>
-		<version>1.1.0</version>
+		<version>1.2.0</version>
 		<relativePath>../pom.xml</relativePath>
 	</parent>
 
@@ -37,12 +37,12 @@
 		<dependency>
 			<groupId>com.google.guava</groupId>
 			<artifactId>guava</artifactId>
-			<version>30.1.1-jre</version>
+			<version>31.0.1-jre</version>
 		</dependency>
 		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<version>4.13.2</version>
+			<groupId>org.junit.jupiter</groupId>
+			<artifactId>junit-jupiter-engine</artifactId>
+			<version>5.8.1</version>
 			<scope>test</scope>
 		</dependency>
 	</dependencies>


Test patch:
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/activation/ActivationStatusBlobInfoTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/activation/ActivationStatusBlobInfoTest.java
index 3d59b0d0..95552a96 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/activation/ActivationStatusBlobInfoTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/activation/ActivationStatusBlobInfoTest.java
@@ -26,8 +26,8 @@ import io.getlime.security.powerauth.crypto.lib.util.KeyDerivationUtils;
 import io.getlime.security.powerauth.crypto.server.activation.PowerAuthServerActivation;
 import io.getlime.security.powerauth.crypto.server.keyfactory.PowerAuthServerKeyFactory;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import javax.crypto.SecretKey;
 import java.nio.ByteBuffer;
@@ -36,7 +36,7 @@ import java.security.KeyPair;
 import java.security.Security;
 import java.util.Arrays;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Test activation status blob.
@@ -48,8 +48,8 @@ public class ActivationStatusBlobInfoTest {
     /**
      * Add crypto providers.
      */
-    @Before
-    public void setUp() {
+    @BeforeAll
+    public static void setUp() {
         // Add Bouncy Castle Security Provider
         Security.addProvider(new BouncyCastleProvider());
     }
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/activation/PowerAuthActivationTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/activation/PowerAuthActivationTest.java
index 86328974..5a95bdfd 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/activation/PowerAuthActivationTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/activation/PowerAuthActivationTest.java
@@ -24,8 +24,8 @@ import io.getlime.security.powerauth.crypto.lib.model.exception.CryptoProviderEx
 import io.getlime.security.powerauth.crypto.lib.util.KeyConvertor;
 import io.getlime.security.powerauth.crypto.server.activation.PowerAuthServerActivation;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import javax.crypto.SecretKey;
 import java.security.KeyPair;
@@ -33,7 +33,7 @@ import java.security.PrivateKey;
 import java.security.PublicKey;
 import java.security.Security;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * @author petrdvorak
@@ -45,8 +45,8 @@ public class PowerAuthActivationTest {
     /**
      * Add crypto providers.
      */
-    @Before
-    public void setUp() {
+    @BeforeAll
+    public static void setUp() {
         // Add Bouncy Castle Security Provider
         Security.addProvider(new BouncyCastleProvider());
     }
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/activation/PowerAuthRecoveryCodeTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/activation/PowerAuthRecoveryCodeTest.java
index 8cb11593..2a64d3e5 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/activation/PowerAuthRecoveryCodeTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/activation/PowerAuthRecoveryCodeTest.java
@@ -23,14 +23,14 @@ import io.getlime.security.powerauth.crypto.lib.model.RecoverySeed;
 import io.getlime.security.powerauth.crypto.lib.model.exception.CryptoProviderException;
 import io.getlime.security.powerauth.crypto.lib.model.exception.GenericCryptoException;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import javax.crypto.SecretKey;
 import java.security.*;
 import java.util.HashSet;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  *
@@ -43,8 +43,8 @@ public class PowerAuthRecoveryCodeTest {
     /**
      * Add crypto providers.
      */
-    @Before
-    public void setUp() {
+    @BeforeAll
+    public static void setUp() {
         // Add Bouncy Castle Security Provider
         Security.addProvider(new BouncyCastleProvider());
     }
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/ec/InvalidPointTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/ec/InvalidPointTest.java
index 0a578f9f..641d0fdd 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/ec/InvalidPointTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/ec/InvalidPointTest.java
@@ -25,16 +25,16 @@ import org.bouncycastle.jce.ECNamedCurveTable;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.bouncycastle.jce.spec.ECNamedCurveParameterSpec;
 import org.bouncycastle.math.ec.custom.sec.SecP256R1Curve;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import java.lang.reflect.Field;
 import java.math.BigInteger;
 import java.security.Security;
 import java.security.spec.InvalidKeySpecException;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 /**
  * Tests for validations during public key import.
@@ -48,8 +48,8 @@ public class InvalidPointTest {
     /**
      * Add BC crypto provider.
      */
-    @Before
-    public void setUp() {
+    @BeforeAll
+    public static void setUp() {
         Security.addProvider(new BouncyCastleProvider());
     }
 
@@ -72,7 +72,7 @@ public class InvalidPointTest {
         } catch (GenericCryptoException ex) {
             return;
         }
-        Assert.fail("Infinity allowed as public key");
+        fail("Infinity allowed as public key");
     }
 
     /**
@@ -86,7 +86,7 @@ public class InvalidPointTest {
         } catch (GenericCryptoException ex) {
             return;
         }
-        Assert.fail("EC point validation is missing");
+        fail("EC point validation is missing");
     }
 
     /**
@@ -100,7 +100,7 @@ public class InvalidPointTest {
         } catch (GenericCryptoException ex) {
             return;
         }
-        Assert.fail("EC point validation is missing");
+        fail("EC point validation is missing");
     }
 
     /**
@@ -114,7 +114,7 @@ public class InvalidPointTest {
         } catch (GenericCryptoException ex) {
             return;
         }
-        Assert.fail("EC point validation is missing");
+        fail("EC point validation is missing");
     }
 
     /**
@@ -128,7 +128,7 @@ public class InvalidPointTest {
         } catch (GenericCryptoException ex) {
             return;
         }
-        Assert.fail("EC point validation is missing");
+        fail("EC point validation is missing");
     }
 
     /**
@@ -144,7 +144,7 @@ public class InvalidPointTest {
         } catch (GenericCryptoException ex) {
             return;
         }
-        Assert.fail("EC point validation is missing");
+        fail("EC point validation is missing");
     }
 
     /**
@@ -167,7 +167,7 @@ public class InvalidPointTest {
             orderField.set(p256curve, orderValid);
             return;
         }
-        Assert.fail("EC point validation is missing");
+        fail("EC point validation is missing");
     }
 
 }
\ No newline at end of file
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/encryption/EciesEncryptorTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/encryption/EciesEncryptorTest.java
index 5d278157..a565a244 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/encryption/EciesEncryptorTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/encryption/EciesEncryptorTest.java
@@ -30,8 +30,8 @@ import io.getlime.security.powerauth.crypto.lib.util.Hash;
 import io.getlime.security.powerauth.crypto.lib.util.KeyConvertor;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.bouncycastle.util.encoders.Hex;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import javax.crypto.SecretKey;
 import java.nio.ByteBuffer;
@@ -43,8 +43,8 @@ import java.security.Security;
 import java.security.interfaces.ECPrivateKey;
 import java.security.interfaces.ECPublicKey;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.fail;
 
 /**
  * Test to validate functionality of {@link EciesEncryptor}
@@ -60,8 +60,8 @@ public class EciesEncryptorTest {
     /**
      * Add crypto providers.
      */
-    @Before
-    public void setUp() {
+    @BeforeAll
+    public static void setUp() {
         // Add Bouncy Castle Security Provider
         Security.addProvider(new BouncyCastleProvider());
     }
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/generator/ActivationCodeGeneratorTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/generator/ActivationCodeGeneratorTest.java
index f2c76c40..a340c415 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/generator/ActivationCodeGeneratorTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/generator/ActivationCodeGeneratorTest.java
@@ -19,12 +19,12 @@ package io.getlime.security.powerauth.crypto.generator;
 import io.getlime.security.powerauth.crypto.lib.generator.IdentifierGenerator;
 import io.getlime.security.powerauth.crypto.lib.model.exception.CryptoProviderException;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import java.security.Security;
 
-import static junit.framework.TestCase.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * Test activation code generator.
@@ -36,8 +36,8 @@ public class ActivationCodeGeneratorTest {
     /**
      * Set up crypto providers
      */
-    @Before
-    public void setUp() {
+    @BeforeAll
+    public static void setUp() {
         // Add Bouncy Castle Security Provider
         Security.addProvider(new BouncyCastleProvider());
     }
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/Argon2Test.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/Argon2Test.java
index 07d589e2..a13bee41 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/Argon2Test.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/Argon2Test.java
@@ -18,11 +18,11 @@ package io.getlime.security.powerauth.crypto.lib.util;
 
 import com.google.common.io.BaseEncoding;
 import io.getlime.security.powerauth.crypto.lib.model.Argon2Hash;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Verify parsing of Argon2 hashes in Modular Crypt Format.
@@ -51,24 +51,32 @@ public class Argon2Test {
         assertArrayEquals(BaseEncoding.base64().decode("wWKIMhR9lyDFvRz9YTZweHKfbftvj+qf+YFY4NeBbtA"), hash19.getDigest());
     }
 
-    @Test(expected = IOException.class)
-    public void testInvalidHash1() throws IOException {
-        Argon2Hash.parse("argon2i$v=19$m=65536,t=2,p=1$c29tZXNhbHQ$wWKIMhR9lyDFvRz9YTZweHKfbftvj+qf+YFY4NeBbtA");
+    @Test
+    public void testInvalidHash1() {
+        assertThrows(IOException.class, () -> {
+            Argon2Hash.parse("argon2i$v=19$m=65536,t=2,p=1$c29tZXNhbHQ$wWKIMhR9lyDFvRz9YTZweHKfbftvj+qf+YFY4NeBbtA");
+        });
     }
 
-    @Test(expected = IOException.class)
-    public void testInvalidHash2() throws IOException {
-        Argon2Hash.parse("$argon2i$v=19$c29tZXNhbHQ$wWKIMhR9lyDFvRz9YTZweHKfbftvj+qf+YFY4NeBbtA");
+    @Test
+    public void testInvalidHash2() {
+        assertThrows(IOException.class, () -> {
+            Argon2Hash.parse("$argon2i$v=19$c29tZXNhbHQ$wWKIMhR9lyDFvRz9YTZweHKfbftvj+qf+YFY4NeBbtA");
+        });
     }
 
-    @Test(expected = IOException.class)
-    public void testInvalidHash3() throws IOException {
-        Argon2Hash.parse("argon2i$v=19$m=65536,t=2,p=1$$wWKIMhR9lyDFvRz9YTZweHKfbftvj+qf+YFY4NeBbtA");
+    @Test
+    public void testInvalidHash3() {
+        assertThrows(IOException.class, () -> {
+            Argon2Hash.parse("argon2i$v=19$m=65536,t=2,p=1$$wWKIMhR9lyDFvRz9YTZweHKfbftvj+qf+YFY4NeBbtA");
+        });
     }
 
-    @Test(expected = IOException.class)
-    public void testInvalidHash4() throws IOException {
-        Argon2Hash.parse("$argon2i$v=19$m=65536,t=2,p=1$c29tZXNhbHQ$");
+    @Test
+    public void testInvalidHash4() {
+        assertThrows(IOException.class, () -> {
+            Argon2Hash.parse("$argon2i$v=19$m=65536,t=2,p=1$c29tZXNhbHQ$");
+        });
     }
 
     @Test
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/CRC16Test.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/CRC16Test.java
index d1bd7f81..4f9dbbbc 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/CRC16Test.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/CRC16Test.java
@@ -16,17 +16,17 @@
  */
 package io.getlime.security.powerauth.crypto.lib.util;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class CRC16Test {
 
-    private CRC16 crc16;
+    private static CRC16 crc16;
 
-    @Before
-    public void setUp() {
+    @BeforeAll
+    public static void setUp() {
         crc16 = new CRC16();
     }
 
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/GenerateVectorDataTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/GenerateVectorDataTest.java
index ed08f8fc..34d5b994 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/GenerateVectorDataTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/GenerateVectorDataTest.java
@@ -31,8 +31,8 @@ import io.getlime.security.powerauth.crypto.lib.model.ActivationVersion;
 import io.getlime.security.powerauth.crypto.lib.util.model.TestSet;
 import io.getlime.security.powerauth.crypto.server.activation.PowerAuthServerActivation;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import javax.crypto.SecretKey;
 import java.io.File;
@@ -50,7 +50,7 @@ import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
 
 /**
  * Generate test vectors
@@ -67,7 +67,7 @@ public class GenerateVectorDataTest {
     /**
      * Register crypto providers
      */
-    @BeforeClass
+    @BeforeAll
     public static void setUp() {
         // Add Bouncy Castle Security Provider
         Security.addProvider(new BouncyCastleProvider());
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/HashBasedCounterUtilsTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/HashBasedCounterUtilsTest.java
index 2e3c37e4..fdd65b1f 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/HashBasedCounterUtilsTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/HashBasedCounterUtilsTest.java
@@ -20,16 +20,16 @@ import io.getlime.security.powerauth.crypto.lib.generator.KeyGenerator;
 import io.getlime.security.powerauth.crypto.lib.model.exception.CryptoProviderException;
 import io.getlime.security.powerauth.crypto.lib.model.exception.GenericCryptoException;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import javax.crypto.SecretKey;
 import java.nio.ByteBuffer;
 import java.security.InvalidKeyException;
 import java.security.Security;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * Test verification of hash calculated from the hash based counter.
@@ -42,8 +42,8 @@ public class HashBasedCounterUtilsTest {
     /**
      * Set up crypto providers
      */
-    @Before
-    public void setUp() {
+    @BeforeAll
+    public static void setUp() {
         // Add Bouncy Castle Security Provider
         Security.addProvider(new BouncyCastleProvider());
     }
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/KeyConversionUtilsTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/KeyConversionUtilsTest.java
index 7fd72eed..9eb0da72 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/KeyConversionUtilsTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/KeyConversionUtilsTest.java
@@ -23,14 +23,14 @@ import org.bouncycastle.jce.ECNamedCurveTable;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.bouncycastle.jce.spec.ECParameterSpec;
 import org.bouncycastle.jce.spec.ECPrivateKeySpec;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import java.math.BigInteger;
 import java.security.*;
 import java.security.interfaces.ECPrivateKey;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * Test for key conversion utilities
@@ -49,8 +49,8 @@ public class KeyConversionUtilsTest {
 	/**
 	 * Set up crypto providers
 	 */
-	@Before
-	public void setUp() {
+	@BeforeAll
+	public static void setUp() {
 		// Add Bouncy Castle Security Provider
 		Security.addProvider(new BouncyCastleProvider());
 	}
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/PasswordHashTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/PasswordHashTest.java
index 5aa6327e..324e4e9a 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/PasswordHashTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/lib/util/PasswordHashTest.java
@@ -16,7 +16,7 @@
  */
 package io.getlime.security.powerauth.crypto.lib.util;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/signature/PowerAuthSignatureFormatTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/signature/PowerAuthSignatureFormatTest.java
index c03a42d5..28c05259 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/signature/PowerAuthSignatureFormatTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/signature/PowerAuthSignatureFormatTest.java
@@ -19,10 +19,9 @@ package io.getlime.security.powerauth.crypto.signature;
 
 import io.getlime.security.powerauth.crypto.lib.enums.PowerAuthSignatureFormat;
 import io.getlime.security.powerauth.crypto.lib.model.exception.GenericCryptoException;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Test that validates whether signature version to signature format works properly.
@@ -40,34 +39,46 @@ public class PowerAuthSignatureFormatTest {
         assertEquals(PowerAuthSignatureFormat.BASE64, PowerAuthSignatureFormat.getFormatForSignatureVersion("4.0"));
     }
 
-    @Test(expected = GenericCryptoException.class)
-    public void testInvalidV2() throws Exception {
-        PowerAuthSignatureFormat.getFormatForSignatureVersion("2.2");
+    @Test
+    public void testInvalidV2() {
+        assertThrows(GenericCryptoException.class, () -> {
+            PowerAuthSignatureFormat.getFormatForSignatureVersion("2.2");
+        });
     }
 
-    @Test(expected = GenericCryptoException.class)
-    public void testInvalidV3() throws Exception {
-        PowerAuthSignatureFormat.getFormatForSignatureVersion("3.05");
+    @Test
+    public void testInvalidV3() {
+        assertThrows(GenericCryptoException.class, () -> {
+            PowerAuthSignatureFormat.getFormatForSignatureVersion("3.05");
+        });
     }
 
-    @Test(expected = GenericCryptoException.class)
-    public void testInvalidFormat1() throws Exception {
-        PowerAuthSignatureFormat.getFormatForSignatureVersion("3.1.1");
+    @Test
+    public void testInvalidFormat1() {
+        assertThrows(GenericCryptoException.class, () -> {
+            PowerAuthSignatureFormat.getFormatForSignatureVersion("3.1.1");
+        });
     }
 
-    @Test(expected = GenericCryptoException.class)
-    public void testInvalidFormat2() throws Exception {
-        PowerAuthSignatureFormat.getFormatForSignatureVersion("foo");
+    @Test
+    public void testInvalidFormat2() {
+        assertThrows(GenericCryptoException.class, () -> {
+            PowerAuthSignatureFormat.getFormatForSignatureVersion("foo");
+        });
     }
 
-    @Test(expected = GenericCryptoException.class)
-    public void testInvalidFormat3() throws Exception {
-        PowerAuthSignatureFormat.getFormatForSignatureVersion("");
+    @Test
+    public void testInvalidFormat3() {
+        assertThrows(GenericCryptoException.class, () -> {
+            PowerAuthSignatureFormat.getFormatForSignatureVersion("");
+        });
     }
 
-    @Test(expected = GenericCryptoException.class)
-    public void testInvalidFormat4() throws Exception {
-        PowerAuthSignatureFormat.getFormatForSignatureVersion(null);
+    @Test
+    public void testInvalidFormat4() {
+        assertThrows(GenericCryptoException.class, () -> {
+            PowerAuthSignatureFormat.getFormatForSignatureVersion(null);
+        });
     }
 
     @Test
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/signature/PowerAuthSignatureTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/signature/PowerAuthSignatureTest.java
index 0aee0afc..79d4d111 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/signature/PowerAuthSignatureTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/signature/PowerAuthSignatureTest.java
@@ -26,8 +26,8 @@ import io.getlime.security.powerauth.crypto.lib.util.KeyConvertor;
 import io.getlime.security.powerauth.crypto.server.keyfactory.PowerAuthServerKeyFactory;
 import io.getlime.security.powerauth.crypto.server.signature.PowerAuthServerSignature;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import javax.crypto.SecretKey;
 import java.nio.ByteBuffer;
@@ -38,8 +38,8 @@ import java.security.Security;
 import java.util.Arrays;
 import java.util.Collections;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * Test for PowerAuth signature calculation and validation.
@@ -54,8 +54,8 @@ public class PowerAuthSignatureTest {
 	/**
 	 * Register crypto providers. 
 	 */
-	@Before
-    public void setUp() {
+	@BeforeAll
+    public static void setUp() {
         // Add Bouncy Castle Security Provider
         Security.addProvider(new BouncyCastleProvider());
     }
diff --git a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/vault/VaultTest.java b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/vault/VaultTest.java
index ef4b1078..fd6785d4 100644
--- a/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/vault/VaultTest.java
+++ b/powerauth-java-crypto/src/test/java/io/getlime/security/powerauth/crypto/vault/VaultTest.java
@@ -24,8 +24,8 @@ import io.getlime.security.powerauth.crypto.lib.generator.KeyGenerator;
 import io.getlime.security.powerauth.crypto.lib.util.KeyConvertor;
 import io.getlime.security.powerauth.crypto.server.vault.PowerAuthServerVault;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import javax.crypto.SecretKey;
 import java.nio.ByteBuffer;
@@ -33,7 +33,7 @@ import java.security.KeyPair;
 import java.security.PrivateKey;
 import java.security.Security;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * Test the secure vault implementation.
@@ -47,8 +47,8 @@ public class VaultTest {
     /**
      * Register crypto providers.
      */
-    @Before
-    public void setUp() {
+    @BeforeAll
+    public static void setUp() {
         // Add Bouncy Castle Security Provider
         Security.addProvider(new BouncyCastleProvider());
     }
diff --git a/powerauth-java-http/src/test/java/io/getlime/security/powerauth/http/PowerAuthHttpBodyTest.java b/powerauth-java-http/src/test/java/io/getlime/security/powerauth/http/PowerAuthHttpBodyTest.java
index c9d145a7..69d1516c 100644
--- a/powerauth-java-http/src/test/java/io/getlime/security/powerauth/http/PowerAuthHttpBodyTest.java
+++ b/powerauth-java-http/src/test/java/io/getlime/security/powerauth/http/PowerAuthHttpBodyTest.java
@@ -17,11 +17,11 @@
 package io.getlime.security.powerauth.http;
 
 import com.google.common.io.BaseEncoding;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.nio.charset.StandardCharsets;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * Tests for HTTP body normalization routine.