From dfd3290dd25bb63435819e2d70a48a2d78835576 Mon Sep 17 00:00:00 2001 From: Udara Pathum <46132469+hwupathum@users.noreply.github.com> Date: Mon, 11 Nov 2024 10:38:58 +0530 Subject: [PATCH] Remove Sun.Java dependency --- .../oauth2/OAuth2ServiceAbstractIntegrationTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oauth2/OAuth2ServiceAbstractIntegrationTest.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oauth2/OAuth2ServiceAbstractIntegrationTest.java index 790ab668f6..554c077004 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oauth2/OAuth2ServiceAbstractIntegrationTest.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oauth2/OAuth2ServiceAbstractIntegrationTest.java @@ -80,7 +80,6 @@ import org.wso2.identity.integration.test.restclients.OAuth2RestClient; import org.wso2.identity.integration.test.util.Utils; import org.wso2.identity.integration.test.utils.OAuth2Constant; -import sun.security.provider.X509Factory; import java.io.File; import java.io.IOException; @@ -116,6 +115,8 @@ public class OAuth2ServiceAbstractIntegrationTest extends ISIntegrationTest { private static final String customClaimURI2 = "http://wso2.org/claims/stateorprovince"; private static final String GRANT_TYPE_PASSWORD = "password"; private static final String SCOPE_PRODUCTION = "PRODUCTION"; + private static final String BEGIN_CERT = "-----BEGIN CERTIFICATE-----"; + private static final String END_CERT = "-----END CERTIFICATE-----"; public static final String OIDC = "oidc"; public static final String SAML = "saml"; private final static int TOMCAT_PORT = 8490; @@ -912,10 +913,8 @@ public void updateApplicationCertificate(String appId, X509Certificate sp1X509Pu */ public String convertToPem(X509Certificate x509Certificate) throws CertificateEncodingException { - String certBegin = X509Factory.BEGIN_CERT; - String endCert = X509Factory.END_CERT; - String pemCert = new String(java.util.Base64.getEncoder().encode(x509Certificate.getEncoded())); - return certBegin + pemCert + endCert; + String pemCert = new String(java.util.Base64.getEncoder().encode(x509Certificate.getEncoded())); + return BEGIN_CERT + pemCert + END_CERT; } /**