You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/04/30 04:20:28 UTC

[camel] branch master updated: jira component: Replace commons Base64 for JDK Base64 (#3785)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new d1877c1  jira component: Replace commons Base64 for JDK Base64 (#3785)
d1877c1 is described below

commit d1877c14c9f4c5219d17ecaf588616152b40f398
Author: Claudio Miranda <cl...@claudius.com.br>
AuthorDate: Thu Apr 30 01:20:09 2020 -0300

    jira component: Replace commons Base64 for JDK Base64 (#3785)
---
 .../camel/component/jira/oauth/JiraOAuthAuthenticationHandler.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/camel-jira/src/main/java/org/apache/camel/component/jira/oauth/JiraOAuthAuthenticationHandler.java b/components/camel-jira/src/main/java/org/apache/camel/component/jira/oauth/JiraOAuthAuthenticationHandler.java
index d3f7785..802c04e 100644
--- a/components/camel-jira/src/main/java/org/apache/camel/component/jira/oauth/JiraOAuthAuthenticationHandler.java
+++ b/components/camel-jira/src/main/java/org/apache/camel/component/jira/oauth/JiraOAuthAuthenticationHandler.java
@@ -20,6 +20,7 @@ import java.security.KeyFactory;
 import java.security.NoSuchAlgorithmException;
 import java.security.spec.InvalidKeySpecException;
 import java.security.spec.PKCS8EncodedKeySpec;
+import java.util.Base64;
 
 import com.atlassian.httpclient.api.Request;
 import com.atlassian.jira.rest.client.api.AuthenticationHandler;
@@ -28,7 +29,6 @@ import com.google.api.client.auth.oauth.OAuthParameters;
 import com.google.api.client.auth.oauth.OAuthRsaSigner;
 import com.google.api.client.http.GenericUrl;
 import com.google.api.client.http.apache.ApacheHttpTransport;
-import com.google.api.client.repackaged.org.apache.commons.codec.binary.Base64;
 
 /**
  * This authentication handler uses the 3-legged OAuth approach described in https://developer.atlassian.com/server/jira/platform/oauth/
@@ -69,7 +69,7 @@ public class JiraOAuthAuthenticationHandler implements AuthenticationHandler {
     }
 
     private OAuthRsaSigner getOAuthRsaSigner(String privateKey) throws NoSuchAlgorithmException, InvalidKeySpecException {
-        byte[] privateBytes = Base64.decodeBase64(privateKey);
+        byte[] privateBytes = Base64.getDecoder().decode(privateKey);
         PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(privateBytes);
         KeyFactory kf = KeyFactory.getInstance("RSA");
         OAuthRsaSigner oAuthRsaSigner = new OAuthRsaSigner();