diff --git a/pom.xml b/pom.xml index ad5ff19..94c54ea 100644 --- a/pom.xml +++ b/pom.xml @@ -14,33 +14,65 @@ UTF-8 UTF-8 - 8 - ${maven.compiler.source} + 25 + 4.11.0 + 1.18.3 + 3.5.0 + 3.15.0 + 3.5.6 + 3.11.0 + 3.5.0 + 3.5.0 + 5.23.0 + 6.1.0 libs ${project.build.directory}/${libs.classpath.prefix} kvsdk4java2.App + + + + com.azure + azure-sdk-bom + ${azure.sdk.bom.version} + pom + import + + + + - - com.microsoft.azure - azure-keyvault-core - 1.2.2 - com.azure - azure-keyvault-keys - 4.0.0-preview.3 + azure-security-keyvault-keys com.azure azure-identity - 1.12.2 com.azure azure-core-http-netty - 1.0.0-preview.4 + + + + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} + test + + + org.mockito + mockito-core + ${mockito.core.version} + test + + + org.mockito + mockito-junit-jupiter + ${mockito.core.version} + test org.junit.jupiter @@ -57,30 +89,32 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + ${maven.compiler.plugin.version} none + ${java.version} + ${java.version} org.apache.maven.plugins maven-surefire-plugin - 2.22.1 + ${maven.surefire.plugin.version} org.apache.maven.plugins maven-dependency-plugin - 3.1.1 + ${maven.dependency.plugin.version} org.apache.maven.plugins maven-resources-plugin - 3.0.2 + ${maven.resources.plugin.version} org.apache.maven.plugins maven-jar-plugin - 3.0.2 + ${maven.jar.plugin.version} @@ -110,13 +144,18 @@ false false true - true runtime - test + + org.apache.maven.plugins + maven-surefire-plugin + + -Dnet.bytebuddy.experimental=true + + diff --git a/src/main/java/kvsdk4java2/App.java b/src/main/java/kvsdk4java2/App.java index 71c64f0..b78388c 100644 --- a/src/main/java/kvsdk4java2/App.java +++ b/src/main/java/kvsdk4java2/App.java @@ -1,7 +1,10 @@ package kvsdk4java2; -import com.azure.identity.credential.ClientSecretCredential; -import com.azure.identity.credential.ClientSecretCredentialBuilder; +import java.nio.charset.StandardCharsets; +import java.util.logging.Logger; + +import com.azure.identity.ClientSecretCredential; +import com.azure.identity.ClientSecretCredentialBuilder; import com.azure.security.keyvault.keys.cryptography.CryptographyAsyncClient; import com.azure.security.keyvault.keys.cryptography.CryptographyClient; import com.azure.security.keyvault.keys.cryptography.CryptographyClientBuilder; @@ -9,9 +12,6 @@ import com.azure.security.keyvault.keys.cryptography.models.EncryptResult; import com.azure.security.keyvault.keys.cryptography.models.EncryptionAlgorithm; -import java.nio.charset.StandardCharsets; -import java.util.logging.Logger; - public class App { static final String AZURE_CLIENT_ID = "Client ID"; @@ -65,7 +65,7 @@ public static void main(String[] args) { log.info("[Encrypted]" + fromUtf16Bytes(encryptResult2.cipherText())); DecryptResult decryptResult2 = cryptographyAsyncClient - .decrypt(EncryptionAlgorithm.RSA_OAEP, encryptResult2.cipherText()) + .decrypt(EncryptionAlgorithm.RSA_OAEP, encryptResult2.getCipherText()) .block(); log.info("[Decrypted]" + textToEncrypt + "<=======>" + fromUtf16Bytes(decryptResult2.plainText())); }