From d1cf6d02ec84d41fa6947df983d494b8e1130098 Mon Sep 17 00:00:00 2001 From: Udara Pathum <46132469+hwupathum@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:02:46 +0530 Subject: [PATCH] Change method return types --- .../org/wso2/carbon/identity/query/saml/util/OpenSAML3Util.java | 2 +- .../carbon/identity/sso/saml/admin/FileBasedConfigManager.java | 2 +- .../org/wso2/carbon/identity/sso/saml/util/SAMLSSOUtil.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/org.wso2.carbon.identity.query.saml/src/main/java/org/wso2/carbon/identity/query/saml/util/OpenSAML3Util.java b/components/org.wso2.carbon.identity.query.saml/src/main/java/org/wso2/carbon/identity/query/saml/util/OpenSAML3Util.java index 88d858e8..f55aa6d2 100644 --- a/components/org.wso2.carbon.identity.query.saml/src/main/java/org/wso2/carbon/identity/query/saml/util/OpenSAML3Util.java +++ b/components/org.wso2.carbon.identity.query.saml/src/main/java/org/wso2/carbon/identity/query/saml/util/OpenSAML3Util.java @@ -316,7 +316,7 @@ public static X509CredentialImpl getX509CredentialImplForTenant(String tenantDom } else { // for super tenant, load the default pub. cert using the // config. in carbon.xml - cert = keyStoreManager.getCachedPrimaryKeyStore().getCertificate(alias); + cert = (java.security.cert.X509Certificate) keyStoreManager.getCachedPrimaryKeyStore().getCertificate(alias); } if (cert == null) { diff --git a/components/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/admin/FileBasedConfigManager.java b/components/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/admin/FileBasedConfigManager.java index b5683d53..4c13c401 100644 --- a/components/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/admin/FileBasedConfigManager.java +++ b/components/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/admin/FileBasedConfigManager.java @@ -324,7 +324,7 @@ private X509Certificate getCertificateFromKeyStore(String alias) { try { KeyStoreManager keyStoreManager = KeyStoreManager.getInstance(MultitenantConstants.SUPER_TENANT_ID); - return keyStoreManager.getCachedPrimaryKeyStore().getCertificate(alias); + return (X509Certificate) keyStoreManager.getCachedPrimaryKeyStore().getCertificate(alias); } catch (Exception e) { String errorMsg = String.format("Error occurred while retrieving the certificate for " + "the alias '%s'." + alias); diff --git a/components/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/util/SAMLSSOUtil.java b/components/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/util/SAMLSSOUtil.java index 88a8e9ea..df7d6947 100644 --- a/components/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/util/SAMLSSOUtil.java +++ b/components/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/util/SAMLSSOUtil.java @@ -971,7 +971,7 @@ public static X509CredentialImpl getX509CredentialImplForTenant(String tenantDom } } else { // for super tenant, load the default pub. cert using the // config. in carbon.xml - cert = keyStoreManager.getCachedPrimaryKeyStore().getCertificate(alias); + cert = (X509Certificate) keyStoreManager.getCachedPrimaryKeyStore().getCertificate(alias); } credentialImpl = new X509CredentialImpl(cert);